[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] qemu: fix cannot get a hot-unplug disk blockdevio settings




On 11/15/2014 06:29 AM, John Ferlan wrote:

On 11/13/2014 10:21 PM, Luyao Huang wrote:

It would help to put the bz link in here:

https://bugzilla.redhat.com/show_bug.cgi?id=1164080

When we try to get a hot-unplug disk blkdevio settings via
qemuDomainGetBlockIoTune, libvirt will output a cannot find
device error.Move the check after confirm vm is running.

"Technically" speaking you're not moving the check after confirming the
vm is running because it is already after that via the call to
virDomainLiveConfigHelperMethod which calls virDomainObjIsActive before
determining how to set *flags.

You're moving the check to only when it's desired to get something from
the active vm (e.g., when the vm is running or the --live flag was
used). Since the 'device' is only ever used within that call - it's
safe/right to move it.
Thanks for the clearly description, i will try to give a more clearly
description next time :)

I updated the bug report with some other details regarding expectations.

Thanks your help in advance.
Signed-off-by: Luyao Huang <lhuang redhat com>
---
  src/qemu/qemu_driver.c | 9 ++++-----
  1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 411179d..c717c76 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17031,12 +17031,11 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
          goto endjob;
      }

-    device = qemuDiskPathToAlias(vm, disk, NULL);
-    if (!device) {
-        goto endjob;
-    }
-
      if (flags & VIR_DOMAIN_AFFECT_LIVE) {
+        device = qemuDiskPathToAlias(vm, disk, NULL);
+        if (!device) {
+            goto endjob;
+        }
mkletzan's recent changes remove the unnecessary brackets.

I'll clean this up and push shortly

John
Thanks for push the patch.
          qemuDomainObjEnterMonitor(driver, vm);
          ret = qemuMonitorGetBlockIoThrottle(priv->mon, device, &reply, supportMaxOptions);
          qemuDomainObjExitMonitor(driver, vm);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]