From: Peter Krempa Date: Tue, 26 Nov 2019 08:28:22 +0000 (+0100) Subject: qemu: blockjob: Properly propagate cancellation of blockjobs X-Git-Tag: v5.10.0-rc2~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a887da529cd2d16f7fa71dabb1bae90f6a2da31b;p=thirdparty%2Flibvirt.git qemu: blockjob: Properly propagate cancellation of blockjobs 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 Reviewed-by: Cole Robinson --- diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 92e4d391c9..2283d49c61 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -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;