libvirt/tests
Peter Krempa 4eb8e9ae8b util: hash: Rewrite sorting of elements in virHashGetItems
All but one of the callers either use the list in arbitrary order or
sorted by key. Rewrite the function so that it supports sorting by key
natively and make it return the element count. This in turn allows to
rewrite the only caller to sort by value internally.

This allows to remove multiple sorting functions which were sorting by
key and the function will be also later reused for some hash operations
internally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Matt Coleman <matt@datto.com>
2020-11-06 10:31:57 +01:00
..
bhyveargv2xmldata bhyve: parse: Set video device model when parsing bhyve commandline 2020-10-19 11:50:49 +02:00
bhyvexml2argvdata bhyve: fix virtio-9p src/dst order 2020-10-12 15:24:21 +04:00
bhyvexml2xmloutdata bhyve: implement virtio-9p support 2020-10-09 18:46:04 +04:00
capabilityschemadata
commanddata tests: commandtest: Make 'test4' checking daemonization more reliable 2020-07-27 15:44:38 +02:00
cputestdata cpu_map: Remove monitor feature from EPYC-Rome 2020-10-08 09:58:44 +02:00
domainbackupxml2xmlin backup: Allow configuring incremental backup per-disk individually 2020-07-08 08:40:30 +02:00
domainbackupxml2xmlout backup: Allow configuring incremental backup per-disk individually 2020-07-08 08:40:30 +02:00
domaincapsdata cpu_map: Remove monitor feature from EPYC-Rome 2020-10-08 09:58:44 +02:00
domainconfdata domainconfdata/getfilesystem.xml: Remove <init> element 2020-10-20 09:05:10 +02:00
domainschemadata
fchostdata/fc_host
genericxml2xmlindata tests: cover disk, interface <backenddomain> 2020-10-05 12:43:00 -04:00
genericxml2xmloutdata tests: cover disk, interface <backenddomain> 2020-10-05 12:43:00 -04:00
interfaceschemadata
libxlxml2domconfigdata libxl: use b_info->{acpi,acpi} when available 2020-09-18 08:51:47 +02:00
lxcconf2xmldata
lxcxml2xmldata
lxcxml2xmloutdata
networkxml2confdata
networkxml2firewalldata
networkxml2xmlin
networkxml2xmlout
networkxml2xmlupdatein
networkxml2xmlupdateout
nodedevmdevctldata
nodedevschemadata node_device: detect CSS devices 2020-09-15 09:06:15 +02:00
nssdata
nwfilterxml2firewalldata nwfilterxml2firewall: Fix schema compilance of 'tcp' test case 2020-10-20 09:05:10 +02:00
nwfilterxml2xmlin nwfilterxml2xmltest: Rename cases with XMLs not conforming to schema 2020-10-20 09:05:10 +02:00
nwfilterxml2xmlout
qemuagentdata
qemublocktestdata qemu: block: Remove 'active-write' bitmap even if there are no bitmaps to merge 2020-07-21 09:52:59 +02:00
qemucapabilitiesdata qemu: capabilities: add QEMU_CAPS_FSDEV_CREATEMODE 2020-11-04 18:25:53 +01:00
qemucaps2xmloutdata
qemudomaincheckpointxml2xmlin
qemudomaincheckpointxml2xmlout
qemudomainsnapshotxml2xmlin
qemudomainsnapshotxml2xmlout
qemufirmwaredata qemufirmwaretest: Test qemuFirmwareFetchConfigs() 2019-03-12 15:29:44 +01:00
qemuhotplugtestcpus
qemuhotplugtestdevices qemu: support hotplug of vdpa devices 2020-10-20 15:15:06 -04:00
qemuhotplugtestdomains qemu: support hotplug of vdpa devices 2020-10-20 15:15:06 -04:00
qemumemlockdata
qemumigparamsdata
qemumonitorjsondata
qemusecuritydata qemusecuritytest: Test SELinux too 2020-11-06 09:14:01 +01:00
qemustatusxml2xmldata qemuDomainObjPrivateAlloc: Use virHashNew instead of virHashCreate 2020-10-22 15:02:46 +02:00
qemuvhostuserdata
qemuxml2argvdata qemu: add support for 'fmode' and 'dmode' 2020-11-04 18:25:56 +01:00
qemuxml2xmloutdata qemu: add 'fmode' and 'dmode' options 2020-11-04 18:25:55 +01:00
secretxml2xmlin
securityselinuxhelperdata
securityselinuxlabeldata
storagepoolcapsschemadata
storagepoolschemadata
storagepoolxml2argvdata storagepoolxml2argvtest: Reorder gluster arguments 2020-11-04 11:54:03 +01:00
storagepoolxml2xmlin conf: add control over COW for storage pool directories 2020-07-23 16:18:09 +01:00
storagepoolxml2xmlout conf: add control over COW for storage pool directories 2020-07-23 16:18:09 +01:00
storagevolschemadata
storagevolxml2argvdata storage: add support for qcow2 LUKS encryption 2020-09-18 11:22:28 +01:00
storagevolxml2xmlin storage: add support for qcow2 LUKS encryption 2020-09-18 11:22:28 +01:00
storagevolxml2xmlout storage: add support for qcow2 LUKS encryption 2020-09-18 11:22:28 +01:00
sysinfodata
vboxsnapshotxmldata
vircaps2xmldata
vircgroupdata
virconfdata rpc: remove use of the term 'whitelist' from RPC code 2020-06-26 15:36:40 +01:00
virfilecachedata
virfiledata
virhostcpudata
virjsondata
virmacmaptestdata
virnetdaemondata tests: fix misc spelling errors reported by codespell 2020-10-05 10:28:43 +01:00
virnetdevopenvswitchdata
virnetdevtestdata/sys/class/net
virnetworkportxml2xmldata
virnwfilterbindingxml2xmldata
virpcitestdata
virresctrldata
virscsidata
virstorageutildata
virusbtestdata/sys_bus_usb/devices
vmwareverdata
vmx2xmldata tests: vmx: Add <name> element for all domain XMLs 2020-10-20 09:05:10 +02:00
xlconfigdata Xen: Add support for writeFiltering in config converter 2020-09-01 14:29:46 -06:00
xmconfigdata Xen: Improve parsing of PCI addresses in config converter 2020-08-21 08:08:28 -06:00
xml2vmxdata Add a check attribute on the mac address element 2020-07-23 16:11:39 +01:00
.valgrind.supp
bhyveargv2xmlmock.c tests: avoid probing host CPU from bhyve test 2020-01-09 18:05:17 +00:00
bhyveargv2xmltest.c bhyve: add VNC password support 2020-09-22 17:19:26 +04:00
bhyvexml2argvmock.c
bhyvexml2argvtest.c bhyve: implement virtio-9p support 2020-10-09 18:46:04 +04:00
bhyvexml2xmltest.c bhyve: implement virtio-9p support 2020-10-09 18:46:04 +04:00
commandhelper.c tests: commandhelper: Accept POLLNVAL on macOS 2020-10-08 17:04:08 +02:00
commandtest.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
cputest.c tests: Remove references to "cpu_map.xml" in the code 2020-10-09 15:38:05 +02:00
domaincapsmock.c domaincapsmock: mock virHostCPUGetMicrocodeVersion() 2020-08-25 19:44:43 +02:00
domaincapstest.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
domainconftest.c
esxutilstest.c
eventtest.c lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
fchosttest.c
fdstreamtest.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
genericxml2xmltest.c tests: cover disk, interface <backenddomain> 2020-10-05 12:43:00 -04:00
interfacexml2xmltest.c
libvirtd-fail
libvirtd-pool
libxlmock.c tests: libxl: do not run the emulator 2020-02-25 12:05:01 +01:00
libxlxml2domconfigtest.c tests: Adjust libxlxml2domconfigtest to work with Xen < 4.10 2020-09-24 12:27:07 +02:00
lxcconf2xmltest.c
lxcxml2xmltest.c
meson.build tests: Use flat namespace for qemu test driver 2020-10-23 13:19:48 +02:00
metadatatest.c
networkxml2conftest.c networkxml2xmltest: Complete renaming of @actual 2020-04-23 12:38:01 +02:00
networkxml2firewalltest.c tests: fix incorrect free of GVariant in our GLib mock functions 2020-10-02 12:43:15 +02:00
networkxml2xmltest.c
networkxml2xmlupdatetest.c
nodedevmdevctltest.c tests: use g_new0 instead of VIR_ALLOC 2020-09-23 14:54:38 +02:00
nodedevxml2xmltest.c node_device: detect CSS devices 2020-09-15 09:06:15 +02:00
nsslinktest.c
nssmock.c tests: use WITH_NSS instead of NSS 2020-07-10 09:40:58 +02:00
nsstest.c tests: use WITH_NSS instead of NSS 2020-07-10 09:40:58 +02:00
nwfilterebiptablestest.c tests: use g_auto for all virBuffers 2020-07-08 16:34:09 -04:00
nwfilterxml2firewalltest.c conf: nwfilter: Replace 'virNWFilterHashTableCreate' with 'virHashNew' 2020-10-22 15:02:46 +02:00
nwfilterxml2xmltest.c nwfilterxml2xmltest: Rename cases with XMLs not conforming to schema 2020-10-20 09:05:10 +02:00
objecteventtest.c
openvzutilstest.c
openvzutilstest.conf
permitted_file_access.txt scripts: remove use of the term 'whitelist' from build helpers 2020-06-26 15:36:40 +01:00
pkix_asn1_tab.c
qemuagenttest.c tests: qemu: use g_autoptr where possible 2020-08-03 07:23:46 +02:00
qemublocktest.c virStorageSourceNew: Abort on failure 2020-09-23 22:37:56 +02:00
qemucapabilitiestest.c tests: get rid of 'make check' references 2020-08-17 08:42:47 +02:00
qemucaps2xmlmock.c
qemucaps2xmltest.c tests: qemu: remove unnecessary labels 2020-08-03 07:23:46 +02:00
qemucapsfixreplies
qemucapsprobe.c
qemucapsprobemock.c Remove all Author(s): lines from source file headers 2018-12-13 16:08:38 +00:00
qemucommandutiltest.c tests: use g_auto for all virBuffers 2020-07-08 16:34:09 -04:00
qemucpumock.c tests: use G_GNUC_UNUSED 2019-10-15 11:25:25 +02:00
qemudomaincheckpointxml2xmltest.c conf: checkpoint: Add a flag storing whether disk 'size' is valid 2020-07-07 12:58:19 +02:00
qemudomainsnapshotxml2xmltest.c tests: qemu: remove unnecessary labels 2020-08-03 07:23:46 +02:00
qemufirmwaretest.c
qemuhotplugmock.c qemu: support hotplug of vdpa devices 2020-10-20 15:15:06 -04:00
qemuhotplugtest.c qemu: support hotplug of vdpa devices 2020-10-20 15:15:06 -04:00
qemumemlocktest.c tests: qemu: remove unnecessary labels 2020-08-03 07:23:46 +02:00
qemumigparamstest.c qemumigparamstest: Validate output parameters against QMP schema 2020-08-24 16:42:57 +02:00
qemumonitorjsontest.c qemu: Update to new design of 'block-export-add' 2020-11-02 14:39:41 +01:00
qemumonitortestutils.c tests: use g_new0 instead of VIR_ALLOC 2020-09-23 14:54:38 +02:00
qemumonitortestutils.h
qemusecuritymock.c qemusecuritytest: Test SELinux too 2020-11-06 09:14:01 +01:00
qemusecuritytest.c qemusecuritytest: Skip on non supported platforms 2020-11-06 09:14:53 +01:00
qemusecuritytest.h
qemuvhostusertest.c
qemuxml2argvmock.c qemu: add vdpa support 2020-10-20 14:48:02 -04:00
qemuxml2argvtest.c qemu: add support for 'fmode' and 'dmode' 2020-11-04 18:25:56 +01:00
qemuxml2xmltest.c qemu: add 'fmode' and 'dmode' options 2020-11-04 18:25:55 +01:00
scsihosttest.c
seclabeltest.c
secretxml2xmltest.c
securityselinuxhelper.c tests: use g_new0 instead of VIR_ALLOC 2020-09-23 14:54:38 +02:00
securityselinuxlabeltest.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
securityselinuxtest.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
shunloadhelper.c tests: use G_GNUC_UNUSED 2019-10-15 11:25:25 +02:00
shunloadtest.c meson: remove '.libs' from all relevant paths 2020-08-03 09:27:00 +02:00
sockettest.c tests: sockettest: move declarations 2020-08-25 19:03:12 +02:00
ssh.c
storagebackendsheepdogtest.c
storagepoolcapstest.c
storagepoolxml2argvtest.c
storagepoolxml2xmltest.c conf: add control over COW for storage pool directories 2020-07-23 16:18:09 +01:00
storagevolxml2argvtest.c storage: add support for qcow2 LUKS encryption 2020-09-18 11:22:28 +01:00
storagevolxml2xmltest.c storage: add support for qcow2 LUKS encryption 2020-09-18 11:22:28 +01:00
sysinfotest.c
test-lib.sh tests: Don't advertise VIR_TEST_EXPENSIVE to users 2020-09-23 11:30:05 +02:00
testutils.c virBitmapNew: Don't check return value 2020-10-05 15:38:47 +02:00
testutils.h meson: remove '.libs' from all relevant paths 2020-08-03 09:27:00 +02:00
testutilshostcpus.h
testutilslxc.c
testutilslxc.h conf: don't use passed in caps in post parse method 2019-12-09 10:15:16 +00:00
testutilsqemu.c remove unnecessary cleanup labels and unused return variables 2020-11-02 22:01:36 -05:00
testutilsqemu.h qemuxml2argvtest: Sanitize testing of '-enable-fips' 2020-10-22 09:03:28 +02:00
testutilsqemuschema.c testutilsqemuschema: Add template checker for schema entries 2020-08-24 13:02:35 +02:00
testutilsqemuschema.h testutilsqemuschema: Add template checker for schema entries 2020-08-24 13:02:35 +02:00
testutilsxen.c
testutilsxen.h
utiltest.c tests: qemu: reduce scope of some variables 2020-08-03 07:23:45 +02:00
vboxsnapshotxmltest.c check for NULL before calling g_regex_unref 2020-09-08 16:07:47 +02:00
viralloctest.c tests: delete VIR_ALLOC tests cases 2020-10-08 19:19:22 +02:00
virauthconfigtest.c tests: authconfigtest: move declarations 2020-08-25 19:03:12 +02:00
virbitmaptest.c virBitmapNew: Don't check return value 2020-10-05 15:38:47 +02:00
virbuftest.c tests: eliminate unnecessary labels 2020-07-08 16:35:54 -04:00
vircaps2xmltest.c
vircapstest.c
vircgroupmock.c tests: fix misc spelling errors reported by codespell 2020-10-05 10:28:43 +01:00
vircgrouptest.c vircgroup: drop @create from virCgroupNewDomainPartition 2020-11-03 21:26:32 +01:00
virconftest.c tests: Use glib memory function in testConfRoundTrip 2020-09-14 17:28:51 +02:00
vircryptotest.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
virdeterministichashmock.c tests: use G_GNUC_UNUSED 2019-10-15 11:25:25 +02:00
virdriverconnvalidatetest.c
virdrivermoduletest.c
virendiantest.c
virerrortest.c
virfilecachemock.c
virfilecachetest.c qemu: don't continue loading caps if outdated 2020-06-23 17:33:30 +01:00
virfilemock.c lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
virfiletest.c lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
virfilewrapper.c
virfilewrapper.h
virfirewalltest.c virfirewalltest: Don't duplicate string when adding it onto stringlist 2020-10-02 12:48:55 +02:00
virgdbusmock.c tests: introduce virgdbusmock to mock GLib DBus functions 2020-09-17 18:19:56 +02:00
virhashdata.h
virhashtest.c util: hash: Rewrite sorting of elements in virHashGetItems 2020-11-06 10:31:57 +01:00
virhostcpumock.c
virhostcputest.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
virhostdevmock.c
virhostdevtest.c tests: use g_new0 instead of VIR_ALLOC 2020-09-23 14:54:38 +02:00
viridentitytest.c meson: remove '.libs' from all relevant paths 2020-08-03 09:27:00 +02:00
viriscsitest.c tests: iscsitest: split out testISCSIScanTargetsTests 2020-08-25 19:03:12 +02:00
virjsontest.c
virkeycodetest.c
virkmodtest.c tests: use g_auto for all virBuffers 2020-07-08 16:34:09 -04:00
virlockspacetest.c
virlogtest.c
virmacmaptest.c tests: remove unneeded cleanup labels 2019-11-19 15:22:43 +01:00
virmigtest.c peer2peer migration: allow connecting to local sockets 2020-09-04 10:20:49 +02:00
virmock.h tests/virmock: extend number of arguments 2020-09-17 18:19:53 +02:00
virmockstathelpers.c tests: fix stat mocking with Fedora rawhide 2020-10-29 19:52:07 +01:00
virnetdaemonmock.c tests: don't mock the time() function on mingw 2020-07-23 14:58:16 +01:00
virnetdaemontest.c tests: use g_new0 instead of VIR_ALLOC 2020-09-23 14:54:38 +02:00
virnetdevbandwidthmock.c
virnetdevbandwidthtest.c tests: use g_auto for all virBuffers 2020-07-08 16:34:09 -04:00
virnetdevmock.c
virnetdevopenvswitchtest.c
virnetdevtest.c tests: remove unneeded cleanup labels 2019-11-19 15:22:43 +01:00
virnetmessagetest.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
virnetserverclientmock.c
virnetserverclienttest.c tests: use g_new0 instead of VIR_ALLOC 2020-09-23 14:54:38 +02:00
virnetsockettest.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
virnettlscontexttest.c lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
virnettlshelpers.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
virnettlshelpers.h lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
virnettlssessiontest.c lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
virnetworkportxml2xmltest.c
virnumamock.c tests: virNumaGetPages: use g_new0 instead of VIR_ALLOC_N 2020-09-23 14:54:38 +02:00
virnwfilterbindingxml2xmltest.c tests: Use g_strdup_printf() instead of virAsprintf() 2019-11-12 16:15:59 +01:00
virpcimock.c virpcimock: Enable on macOS 2020-11-04 11:54:02 +01:00
virpcitest.c
virpolkittest.c tests: fix incorrect free of GVariant in our GLib mock functions 2020-10-02 12:43:15 +02:00
virportallocatormock.c lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
virportallocatortest.c lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
virprocessmock.c tests: use G_GNUC_UNUSED 2019-10-15 11:25:25 +02:00
virrandommock.c
virresctrltest.c
virrotatingfiletest.c Split declarations from initializations 2020-08-25 19:03:11 +02:00
virschematest.c change DIR* int g_autoptr(DIR) where appropriate 2020-11-02 22:01:36 -05:00
virscsitest.c
virsh-auth
virsh-auth.xml
virsh-checkpoint
virsh-cpuset
virsh-define-dev-segfault
virsh-int-overflow
virsh-optparse meson: src/util/virfile: rewrite virFileActivateDirOverrideForProg 2020-08-03 09:26:36 +02:00
virsh-read-bufsiz
virsh-read-non-seekable
virsh-schedinfo meson: src/util/virfile: rewrite virFileActivateDirOverrideForProg 2020-08-03 09:26:36 +02:00
virsh-self-test
virsh-snapshot
virsh-start
virsh-undefine tests: fix license blurb in virsh-undefine 2020-09-01 23:14:16 +02:00
virsh-uriprecedence
virsh-vcpupin
virshtest.c
virstoragetest.c virStorageSourceNew: Abort on failure 2020-09-23 22:37:56 +02:00
virstorageutiltest.c
virstringtest.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
virsystemdtest.c tests: fix incorrect free of GVariant in our GLib mock functions 2020-10-02 12:43:15 +02:00
virt-aa-helper-test meson: tests: add test scripts 2020-08-03 09:27:06 +02:00
virt-admin-self-test
virtestmock.c meson: tests: add file access test setup 2020-08-03 09:27:06 +02:00
virtimetest.c
virtypedparamtest.c
viruritest.c tests: use VIR_WARNINGS_NO_DECLARATION_AFTER_STATEMENT 2020-08-25 19:03:13 +02:00
virusbmock.c
virusbtest.c
vmwarevertest.c
vmx2xmltest.c vmx: start parsing SATA disks 2020-10-14 11:23:30 +02:00
vshtabletest.c lib: Prefer WITH_* prefix for #if conditionals 2020-09-02 10:28:10 +02:00
xlconfigtest.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
xmconfigtest.c tests: use g_new0 instead of VIR_ALLOC_N 2020-09-23 16:49:01 +02:00
xml2vmxtest.c Add a type attribute on the mac address element 2020-07-13 18:47:44 +02:00