[PATCH] testQemuGetLatestCaps: Lower chances of hash collision

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This function creates a list of paths to the latest capabilities
and returns them in a hash table where key is an arch string and
value is the path. Well, we know how many arches there are so
might as well use that as initial hash size.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 tests/testutilsqemu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index bce847ce5e..2d6a84d017 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -879,7 +879,7 @@ testQemuGetLatestCaps(void)
     virHashTablePtr capslatest;
     size_t i;
 
-    if (!(capslatest = virHashCreate(4, virHashValueFree)))
+    if (!(capslatest = virHashCreate(ARRAY_CARDINALITY(archs), virHashValueFree)))
         goto error;
 
     VIR_TEST_VERBOSE("\n");
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux