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 <pkrempa@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Peter Krempa 2019-11-26 09:28:22 +01:00
parent 01270a9a5f
commit a887da529c

View 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;