[PATCH 5/9] virStorageFileGetMetadataRecurse: Use virHashHasEntry instead of fake pointers

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

 



Replacing virHashLookup by virHashHasEntry allows to use NULL as the
payload of the hash table rather than putting a fake '1' pointer into
the table.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/util/virstoragefile.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index cf37744d6f..bb3fa65a14 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -4992,14 +4992,14 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
     if (!(uniqueName = virStorageFileGetUniqueIdentifier(src)))
         goto cleanup;

-    if (virHashLookup(cycle, uniqueName)) {
+    if (virHashHasEntry(cycle, uniqueName)) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("backing store for %s (%s) is self-referential"),
                        NULLSTR(src->path), uniqueName);
         goto cleanup;
     }

-    if (virHashAddEntry(cycle, uniqueName, (void *)1) < 0)
+    if (virHashAddEntry(cycle, uniqueName, NULL) < 0)
         goto cleanup;

     if ((headerLen = virStorageFileRead(src, 0, VIR_STORAGE_MAX_HEADER,
-- 
2.24.1





[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