]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Fix virsh freeze when blockcopy storage file is removed
authorErik Skultety <eskultet@redhat.com>
Wed, 3 Dec 2014 12:56:47 +0000 (13:56 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 4 Dec 2014 08:05:59 +0000 (09:05 +0100)
If someone removes blockcopy storage file when still in mirroring phase
and then requesting blockjob abort using pivot, virsh cmd freezes. This
is not an issue with older qemu versions which did not support
asynchronous jobs (which we prefer by default).
As we have reached the mirroring phase successfully, polling monitor for
blockjob info always returns 1 and the loop never ends.
This fix introduces a check for qemuDomainBlockPivot return code, possibly
skipping the asynchronous waiting completely, if an error occurred and
asynchronous waiting was the preferred method.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1139567

src/qemu/qemu_driver.c

index 31565bb74b13429d7d4a30bd3ec0aec3a23fbd7e..b9935e4a7adb1bafa591c47ca0bfe7ac495f530b 100644 (file)
@@ -15606,6 +15606,8 @@ qemuDomainBlockJobImpl(virDomainObjPtr vm,
 
         if (disk->mirror && (flags & VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT)) {
             ret = qemuDomainBlockPivot(conn, driver, vm, device, disk);
+            if (ret < 0 && async)
+                goto endjob;
             goto waitjob;
         }
         if (disk->mirror) {