From: Peter Krempa Date: Fri, 14 Feb 2020 15:36:26 +0000 (+0100) Subject: virStorageFileGetMetadataRecurse: Remove impossible error report X-Git-Tag: v6.1.0-rc1~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84df98f29e031d3b1e68e7e3c0d2651ccba14106;p=thirdparty%2Flibvirt.git virStorageFileGetMetadataRecurse: Remove impossible error report 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 Reviewed-by: Eric Blake --- diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c index 4d2e39246c..7aeeab0739 100644 --- a/src/util/virstoragefile.c +++ b/src/util/virstoragefile.c @@ -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)