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

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

 



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@xxxxxxxxxx>
---
 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

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]