render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
d76c62
From cf65fbfb12a209e760b8b2f2b16acfd8b33e8bee Mon Sep 17 00:00:00 2001
d76c62
Message-Id: <cf65fbfb12a209e760b8b2f2b16acfd8b33e8bee@dist-git>
d76c62
From: Peter Krempa <pkrempa@redhat.com>
d76c62
Date: Fri, 28 Feb 2020 10:24:29 +0100
d76c62
Subject: [PATCH] virStorageFileGetMetadataRecurse: Remove impossible error
d76c62
 report
d76c62
MIME-Version: 1.0
d76c62
Content-Type: text/plain; charset=UTF-8
d76c62
Content-Transfer-Encoding: 8bit
d76c62
d76c62
We call virStorageFileSupportsBackingChainTraversal which already checks
d76c62
that the 'storageFileRead' callback is non-NULL, which in turn means
d76c62
that virStorageFileRead will not return -2.
d76c62
d76c62
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
d76c62
Reviewed-by: Eric Blake <eblake@redhat.com>
d76c62
(cherry picked from commit 84df98f29e031d3b1e68e7e3c0d2651ccba14106)
d76c62
d76c62
https://bugzilla.redhat.com/show_bug.cgi?id=1798148
d76c62
Message-Id: <bb902dffc6692251cf12a14fcf5b25a62054a20b.1582881363.git.pkrempa@redhat.com>
d76c62
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d76c62
---
d76c62
 src/util/virstoragefile.c | 9 +--------
d76c62
 1 file changed, 1 insertion(+), 8 deletions(-)
d76c62
d76c62
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
d76c62
index 6b83fc0e24..1f18320756 100644
d76c62
--- a/src/util/virstoragefile.c
d76c62
+++ b/src/util/virstoragefile.c
d76c62
@@ -5003,15 +5003,8 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
d76c62
         goto cleanup;
d76c62
 
d76c62
     if ((headerLen = virStorageFileRead(src, 0, VIR_STORAGE_MAX_HEADER,
d76c62
-                                        &buf)) < 0) {
d76c62
-        if (headerLen == -2)
d76c62
-            virReportError(VIR_ERR_INTERNAL_ERROR,
d76c62
-                           _("storage file reading is not supported for "
d76c62
-                             "storage type %s (protocol: %s)"),
d76c62
-                           virStorageTypeToString(src->type),
d76c62
-                           virStorageNetProtocolTypeToString(src->protocol));
d76c62
+                                        &buf)) < 0)
d76c62
         goto cleanup;
d76c62
-    }
d76c62
 
d76c62
     if (virStorageFileGetMetadataInternal(src, buf, headerLen,
d76c62
                                           &backingFormat) < 0)
d76c62
-- 
d76c62
2.25.1
d76c62