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