[libvirt] [PATCH] qemu: Don't fail if physical size can't be updated in qemuDomainGetBlockInfo

Peter Krempa posted 1 patch 7 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/5ec182fb58d39249dfa2fd0439c9475f35cff85e.1492696186.git.pkrempa@redhat.com
src/qemu/qemu_driver.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
[libvirt] [PATCH] qemu: Don't fail if physical size can't be updated in qemuDomainGetBlockInfo
Posted by Peter Krempa 7 years ago
Since commit c5f6151390 qemuDomainBlockInfo tries to update the
"physical" storage size for all network storage and not only block
devices.

Since the storage driver APIs to do this are not implemented for certain
storage types (RBD, iSCSI, ...) the code would fail to retrieve any data
since the failure of qemuDomainStorageUpdatePhysical is fatal.

Since it's desired to return data even if the total size can't be
updated we need to ignore errors from that fucntion and return plausible
data.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1442344
---

Notes:
    This function will require more fixing though. This is just a bandaid to
    remove the regression. I'll post other patches as follow up later.

 src/qemu/qemu_driver.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e39de625d..8ff242597 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -11553,10 +11553,12 @@ qemuDomainGetBlockInfo(virDomainPtr dom,
         if (info->allocation == 0)
             info->allocation = entry->physical;

-        if (qemuDomainStorageUpdatePhysical(driver, cfg, vm, disk->src) < 0)
-            goto endjob;
-
-        info->physical = disk->src->physical;
+        if (qemuDomainStorageUpdatePhysical(driver, cfg, vm, disk->src) == 0) {
+            info->physical = disk->src->physical;
+        } else {
+            virResetLastError();
+            info->physical = entry->physical;
+        }
     } else {
         info->physical = entry->physical;
     }
-- 
2.12.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Don't fail if physical size can't be updated in qemuDomainGetBlockInfo
Posted by Peter Krempa 6 years, 12 months ago
On Thu, Apr 20, 2017 at 15:50:00 +0200, Peter Krempa wrote:
> Since commit c5f6151390 qemuDomainBlockInfo tries to update the
> "physical" storage size for all network storage and not only block
> devices.
> 
> Since the storage driver APIs to do this are not implemented for certain
> storage types (RBD, iSCSI, ...) the code would fail to retrieve any data
> since the failure of qemuDomainStorageUpdatePhysical is fatal.
> 
> Since it's desired to return data even if the total size can't be
> updated we need to ignore errors from that fucntion and return plausible
> data.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1442344
> ---

Ping
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] qemu: Don't fail if physical size can't be updated in qemuDomainGetBlockInfo
Posted by John Ferlan 6 years, 12 months ago

On 04/20/2017 09:50 AM, Peter Krempa wrote:
> Since commit c5f6151390 qemuDomainBlockInfo tries to update the
> "physical" storage size for all network storage and not only block
> devices.
> 
> Since the storage driver APIs to do this are not implemented for certain
> storage types (RBD, iSCSI, ...) the code would fail to retrieve any data
> since the failure of qemuDomainStorageUpdatePhysical is fatal.
> 
> Since it's desired to return data even if the total size can't be
> updated we need to ignore errors from that fucntion and return plausible

function

> data.
> 
> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1442344
> ---
> 
> Notes:
>     This function will require more fixing though. This is just a bandaid to
>     remove the regression. I'll post other patches as follow up later.
> 
>  src/qemu/qemu_driver.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 

ACK

John

could have sworn I looked at this late last week and responded to it.

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list