render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
3e5111
From 19acba61eef5c5caf17e5b75b4e2ea30458a18b3 Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <19acba61eef5c5caf17e5b75b4e2ea30458a18b3@dist-git>
3e5111
From: Peter Krempa <pkrempa@redhat.com>
3e5111
Date: Fri, 28 Apr 2017 10:37:00 +0200
3e5111
Subject: [PATCH] qemu: Don't fail if physical size can't be updated in
3e5111
 qemuDomainGetBlockInfo
3e5111
3e5111
Since commit c5f6151390 qemuDomainBlockInfo tries to update the
3e5111
"physical" storage size for all network storage and not only block
3e5111
devices.
3e5111
3e5111
Since the storage driver APIs to do this are not implemented for certain
3e5111
storage types (RBD, iSCSI, ...) the code would fail to retrieve any data
3e5111
since the failure of qemuDomainStorageUpdatePhysical is fatal.
3e5111
3e5111
Since it's desired to return data even if the total size can't be
3e5111
updated we need to ignore errors from that function and return plausible
3e5111
data.
3e5111
3e5111
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1442344
3e5111
(cherry picked from commit 9f16bb7386939c400a7522d2489245f1e6831bae)
3e5111
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/qemu/qemu_driver.c | 10 ++++++----
3e5111
 1 file changed, 6 insertions(+), 4 deletions(-)
3e5111
3e5111
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
3e5111
index 3f3eca440..2fcf4612e 100644
3e5111
--- a/src/qemu/qemu_driver.c
3e5111
+++ b/src/qemu/qemu_driver.c
3e5111
@@ -11567,10 +11567,12 @@ qemuDomainGetBlockInfo(virDomainPtr dom,
3e5111
         if (info->allocation == 0)
3e5111
             info->allocation = entry->physical;
3e5111
 
3e5111
-        if (qemuDomainStorageUpdatePhysical(driver, cfg, vm, disk->src) < 0)
3e5111
-            goto endjob;
3e5111
-
3e5111
-        info->physical = disk->src->physical;
3e5111
+        if (qemuDomainStorageUpdatePhysical(driver, cfg, vm, disk->src) == 0) {
3e5111
+            info->physical = disk->src->physical;
3e5111
+        } else {
3e5111
+            virResetLastError();
3e5111
+            info->physical = entry->physical;
3e5111
+        }
3e5111
     } else {
3e5111
         info->physical = entry->physical;
3e5111
     }
3e5111
-- 
3e5111
2.12.2
3e5111