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

Luyao Huang lhuang at redhat.com
Fri Nov 14 03:21:10 UTC 2014


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.

Signed-off-by: Luyao Huang <lhuang at 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;
+        }
         qemuDomainObjEnterMonitor(driver, vm);
         ret = qemuMonitorGetBlockIoThrottle(priv->mon, device, &reply, supportMaxOptions);
         qemuDomainObjExitMonitor(driver, vm);
-- 
1.8.3.1




More information about the libvir-list mailing list