50 lines
1.8 KiB
Diff
50 lines
1.8 KiB
Diff
|
From 20f764d1837f06b10c7c327b085234b6e5f876e2 Mon Sep 17 00:00:00 2001
|
||
|
Message-Id: <20f764d1837f06b10c7c327b085234b6e5f876e2@dist-git>
|
||
|
From: Peter Krempa <pkrempa@redhat.com>
|
||
|
Date: Fri, 28 Feb 2020 10:24:32 +0100
|
||
|
Subject: [PATCH] virStorageFileGetMetadataRecurse: Use virHashHasEntry instead
|
||
|
of fake pointers
|
||
|
MIME-Version: 1.0
|
||
|
Content-Type: text/plain; charset=UTF-8
|
||
|
Content-Transfer-Encoding: 8bit
|
||
|
|
||
|
Replacing virHashLookup by virHashHasEntry allows us 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@redhat.com>
|
||
|
Reviewed-by: Eric Blake <eblake@redhat.com>
|
||
|
(cherry picked from commit e3960f4b6d0b6d8cb8b2631f8358abf289c1cc18)
|
||
|
|
||
|
https://bugzilla.redhat.com/show_bug.cgi?id=1798148
|
||
|
Message-Id: <af53b5ff04169cfa8e40664f2b66f110560486ee.1582881363.git.pkrempa@redhat.com>
|
||
|
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||
|
---
|
||
|
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 28d1d1aa1e..46d55eda96 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.25.1
|
||
|
|