]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virStorageFileGetMetadataRecurse: Remove impossible error report
authorPeter Krempa <pkrempa@redhat.com>
Fri, 14 Feb 2020 15:36:26 +0000 (16:36 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 20 Feb 2020 06:57:08 +0000 (07:57 +0100)
We call virStorageFileSupportsBackingChainTraversal which already checks
that the 'storageFileRead' callback is non-NULL, which in turn means
that virStorageFileRead will not return -2.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
src/util/virstoragefile.c

index 4d2e39246cc9cca2c33df1f73fccca70709d47cc..7aeeab0739c3dfe7422e5188321c77b52f7d62e2 100644 (file)
@@ -5003,15 +5003,8 @@ virStorageFileGetMetadataRecurse(virStorageSourcePtr src,
         goto cleanup;
 
     if ((headerLen = virStorageFileRead(src, 0, VIR_STORAGE_MAX_HEADER,
-                                        &buf)) < 0) {
-        if (headerLen == -2)
-            virReportError(VIR_ERR_INTERNAL_ERROR,
-                           _("storage file reading is not supported for "
-                             "storage type %s (protocol: %s)"),
-                           virStorageTypeToString(src->type),
-                           virStorageNetProtocolTypeToString(src->protocol));
+                                        &buf)) < 0)
         goto cleanup;
-    }
 
     if (virStorageFileGetMetadataInternal(src, buf, headerLen,
                                           &backingFormat) < 0)