[libvirt] [PATCH] qemu: Fix virsh freeze when blockcopy storage file is removed

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 occured and asynchronous waiting was the preferred method. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1139567 --- src/qemu/qemu_driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 5dc62b0..2e11938 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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) { -- 1.9.3

On 12/03/2014 05:56 AM, Erik Skultety wrote:
If someone removes blockcopy storage file when still in mirroring phase
That's fishy behavior on the part of the user. But since the patch is simple enough, it's still worth protecting ourselves from stupid users.
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 occured and
s/occured/occurred/
asynchronous waiting was the preferred method.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1139567 --- src/qemu/qemu_driver.c | 2 ++ 1 file changed, 2 insertions(+)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 03.12.2014 17:39, Eric Blake wrote:
On 12/03/2014 05:56 AM, Erik Skultety wrote:
If someone removes blockcopy storage file when still in mirroring phase
That's fishy behavior on the part of the user. But since the patch is simple enough, it's still worth protecting ourselves from stupid users.
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 occured and
s/occured/occurred/
asynchronous waiting was the preferred method.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1139567 --- src/qemu/qemu_driver.c | 2 ++ 1 file changed, 2 insertions(+)
ACK.
Fixed and pushed now. Michal
participants (3)
-
Eric Blake
-
Erik Skultety
-
Michal Privoznik