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