]> xenbits.xensource.com Git - libvirt.git/commitdiff
blockjob: wait for pivot to complete
authorEric Blake <eblake@redhat.com>
Mon, 14 Jul 2014 16:13:18 +0000 (10:13 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 16 Jul 2014 13:23:24 +0000 (07:23 -0600)
https://bugzilla.redhat.com/show_bug.cgi?id=1119173 documents that
commit eaba79d was flawed in the implementation of the
VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC flag when it comes to completing
a blockcopy.  Basically, the qemu pivot action is async (the QMP
command returns immediately, but the user must wait for the
BLOCK_JOB_COMPLETE event to know that all I/O related to the job
has finally been flushed), but the libvirt command was documented
as synchronous by default.  As active block commit will also be
using this code, it is worth fixing now.

* src/qemu/qemu_driver.c (qemuDomainBlockJobImpl): Don't skip wait
loop after pivot.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_driver.c

index 62b7f079f485cdf702a9dbdb279ecef01d70abbf..1652744ed5740f27e5ff664f058a5c9f0044abe4 100644 (file)
@@ -14981,7 +14981,7 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm,
     if (disk->mirror && mode == BLOCK_JOB_ABORT &&
         (flags & VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT)) {
         ret = qemuDomainBlockPivot(conn, driver, vm, device, disk);
-        goto endjob;
+        goto waitjob;
     }
 
     if (base &&
@@ -15038,6 +15038,7 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm,
         disk->mirroring = false;
     }
 
+ waitjob:
     /* With synchronous block cancel, we must synthesize an event, and
      * we silently ignore the ABORT_ASYNC flag.  With asynchronous
      * block cancel, the event will come from qemu, but without the