util/virhash: add name parameter to virHashSearch

While searching for an element using a function it may be
desirable to know the element key for future operation.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Pavel Hrdina
2017-07-20 14:02:14 +02:00
parent 84359339c5
commit 38e516a524
8 changed files with 20 additions and 13 deletions
+1 -1
View File
@@ -436,7 +436,7 @@ testHashSearch(const void *data ATTRIBUTE_UNUSED)
if (!(hash = testHashInit(0)))
return -1;
entry = virHashSearch(hash, testHashSearchIter, NULL);
entry = virHashSearch(hash, testHashSearchIter, NULL, NULL);
if (!entry || STRNEQ(uuids_subset[testSearchIndex], entry)) {
VIR_TEST_VERBOSE("\nvirHashSearch didn't find entry '%s'\n",