render / rpms / libvirt

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