Blame SOURCES/libvirt-util-storagefile-Don-t-report-errors-from-virStorageSourceUpdatePhysicalSize.patch

d759b5
From 78d68159183b07c1ab1d148dc6ddd05abbf0c5f4 Mon Sep 17 00:00:00 2001
d759b5
Message-Id: <78d68159183b07c1ab1d148dc6ddd05abbf0c5f4@dist-git>
d759b5
From: Peter Krempa <pkrempa@redhat.com>
d759b5
Date: Fri, 16 Aug 2019 14:36:55 +0200
d759b5
Subject: [PATCH] util: storagefile: Don't report errors from
d759b5
 virStorageSourceUpdatePhysicalSize
d759b5
MIME-Version: 1.0
d759b5
Content-Type: text/plain; charset=UTF-8
d759b5
Content-Transfer-Encoding: 8bit
d759b5
d759b5
virStorageSourceUpdatePhysicalSize is called only from
d759b5
qemuDomainStorageUpdatePhysical and all callers of it reset the libvirt
d759b5
error if -1 is returned.
d759b5
d759b5
Don't bother setting the error in the first place.
d759b5
d759b5
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
d759b5
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d759b5
(cherry picked from commit b074363136ddcf1599c36f11b9f5a5fe45c5b3e5)
d759b5
d759b5
 Conflicts:
d759b5
	src/util/virstoragefile.c:
d759b5
         Code reformatting patch 34e9c29357e not backported so the
d759b5
         context was different.
d759b5
d759b5
https: //bugzilla.redhat.com/show_bug.cgi?id=1724808
d759b5
Message-Id: <a745996bdbc9be42461a8c023b821102a105ed66.1565958905.git.pkrempa@redhat.com>
d759b5
Reviewed-by: Ján Tomko <jtomko@redhat.com>
d759b5
---
d759b5
 src/util/virstoragefile.c | 12 ++----------
d759b5
 1 file changed, 2 insertions(+), 10 deletions(-)
d759b5
d759b5
diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
d759b5
index 099ff62f75..09dd8e3084 100644
d759b5
--- a/src/util/virstoragefile.c
d759b5
+++ b/src/util/virstoragefile.c
d759b5
@@ -3699,7 +3699,7 @@ virStorageSourceNewFromBacking(virStorageSourcePtr parent)
d759b5
  * To be called for domain storage source reporting as the volume code does
d759b5
  * not set/use the 'type' field for the voldef->source.target
d759b5
  *
d759b5
- * Returns 0 on success, -1 on error.
d759b5
+ * Returns 0 on success, -1 on error. No libvirt errors are reported.
d759b5
  */
d759b5
 int
d759b5
 virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src,
d759b5
@@ -3716,11 +3716,8 @@ virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src,
d759b5
         break;
d759b5
 
d759b5
     case VIR_STORAGE_TYPE_BLOCK:
d759b5
-        if ((end = lseek(fd, 0, SEEK_END)) == (off_t) -1) {
d759b5
-            virReportSystemError(errno, _("failed to seek to end of '%s'"),
d759b5
-                                 src->path);
d759b5
+        if ((end = lseek(fd, 0, SEEK_END)) == (off_t) -1)
d759b5
             return -1;
d759b5
-        }
d759b5
 
d759b5
         src->physical = end;
d759b5
         break;
d759b5
@@ -3733,12 +3730,7 @@ virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src,
d759b5
     case VIR_STORAGE_TYPE_VOLUME:
d759b5
     case VIR_STORAGE_TYPE_NONE:
d759b5
     case VIR_STORAGE_TYPE_LAST:
d759b5
-        virReportError(VIR_ERR_INTERNAL_ERROR,
d759b5
-                      _("cannot retrieve physical for path '%s' type '%s'"),
d759b5
-                      NULLSTR(src->path),
d759b5
-                      virStorageTypeToString(actual_type));
d759b5
         return -1;
d759b5
-        break;
d759b5
     }
d759b5
 
d759b5
     return 0;
d759b5
-- 
d759b5
2.22.1
d759b5