]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: blockjob: Properly propagate cancellation of blockjobs
authorPeter Krempa <pkrempa@redhat.com>
Tue, 26 Nov 2019 08:28:22 +0000 (09:28 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 27 Nov 2019 14:59:33 +0000 (15:59 +0100)
qemu returns an error message in the job statistics even if the job was
cancelled to emphasize it was not successful. Libvirt didn't properly
transform it into QEMU_BLOCKJOB_STATE_CANCELLED though.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
src/qemu/qemu_blockjob.c

index 92e4d391c99767b0991dfdb0160a151b789a1e19..2283d49c616a4f4fccebd7abd183d1bbf5f807db 100644 (file)
@@ -1313,7 +1313,8 @@ qemuBlockJobEventProcessConcluded(qemuBlockJobDataPtr job,
     if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
         goto cleanup;
 
-    if (job->newstate == QEMU_BLOCKJOB_STATE_COMPLETED &&
+    if ((job->newstate == QEMU_BLOCKJOB_STATE_COMPLETED ||
+         job->newstate == QEMU_BLOCKJOB_STATE_FAILED) &&
         job->state == QEMU_BLOCKJOB_STATE_ABORTING)
         job->newstate = QEMU_BLOCKJOB_STATE_CANCELLED;