[PATCH] qemu: Fix all callers of qemuMonitorGetBlockJobInfo()

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

 



Commit 1b43885 modified one of the callers of this function to take
into account the possible return value of 0 when the block job can't be
found.

This commit finishes the job by updating the remaining caller.
---
 src/qemu/qemu_driver.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 304165c..c4573d9 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -16150,14 +16150,13 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
         rc = qemuMonitorGetBlockJobInfo(priv->mon, disk->info.alias, &info);
         if (qemuDomainObjExitMonitor(driver, vm) < 0)
             goto cleanup;
-        if (rc < 0)
+        if (rc <= 0)
             goto cleanup;
-        if (rc == 1 &&
-            (info.ready == 1 ||
-             (info.ready == -1 &&
-              info.end == info.cur &&
-              (info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY ||
-               info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT))))
+        if (info.ready == 1 ||
+            (info.ready == -1 &&
+             info.end == info.cur &&
+             (info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COPY ||
+              info.type == VIR_DOMAIN_BLOCK_JOB_TYPE_COMMIT)))
             disk->mirrorState = VIR_DOMAIN_DISK_MIRROR_STATE_READY;
     }
 
-- 
2.5.0

--
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]