Blame SOURCES/libvirt-storage-util-Properly-ignore-errors-when-backing-volume-is-inaccessible.patch

404507
From a921cd57872bf1ed798df6c7268d07c29cba9e32 Mon Sep 17 00:00:00 2001
404507
Message-Id: <a921cd57872bf1ed798df6c7268d07c29cba9e32@dist-git>
404507
From: Peter Krempa <pkrempa@redhat.com>
404507
Date: Tue, 30 Jan 2018 13:02:02 +0100
404507
Subject: [PATCH] storage: util: Properly ignore errors when backing volume is
404507
 inaccessible
404507
404507
Commit 000e9504559 tried to fix improper bracketing when refreshing disk
404507
volume stats for a backing volume. Unfortunately the condition is still
404507
wrong as in cases as the backing store being inaccessible
404507
storageBackendUpdateVolTargetInfo returns -2 if instructed to ignore
404507
errors. The condition does not take this into account.
404507
404507
Dumping XML of a volume which has inacessible backing store would then
404507
result into:
404507
404507
 # virsh vol-dumpxml http.img --pool default
404507
 error: An error occurred, but the cause is unknown
404507
404507
Properly ignore -2 for backing volumes.
404507
404507
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1540022
404507
(cherry picked from commit b2c5f28a72465bf047311828c8c66112c8ca84e5)
404507
---
404507
 src/storage/storage_util.c | 2 +-
404507
 1 file changed, 1 insertion(+), 1 deletion(-)
404507
404507
diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c
404507
index 9e1b63a436..61a87b37b6 100644
404507
--- a/src/storage/storage_util.c
404507
+++ b/src/storage/storage_util.c
404507
@@ -1918,7 +1918,7 @@ virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol,
404507
                                                  withBlockVolFormat,
404507
                                                  VIR_STORAGE_VOL_OPEN_DEFAULT |
404507
                                                  VIR_STORAGE_VOL_OPEN_NOERROR,
404507
-                                                 readflags)) < 0)
404507
+                                                 readflags)) == -1)
404507
         return ret;
404507
 
404507
     return 0;
404507
-- 
404507
2.16.1
404507