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

Andrea Bolognani abologna at redhat.com
Mon Jan 4 14:20:01 UTC 2016


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




More information about the libvir-list mailing list