Use the helper which cancels all blockjobs to perform the backup job
cancellation in qemuDomainAbortJob.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
src/qemu/qemu_driver.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6bc9c7c6d7..69bc94be9d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14048,11 +14048,16 @@ static int qemuDomainAbortJob(virDomainPtr dom)
}
VIR_DEBUG("Cancelling job at client request");
- qemuDomainObjAbortAsyncJob(vm);
- qemuDomainObjEnterMonitor(driver, vm);
- ret = qemuMonitorMigrateCancel(priv->mon);
- if (qemuDomainObjExitMonitor(driver, vm) < 0)
- ret = -1;
+ if (priv->job.asyncJob == QEMU_ASYNC_JOB_BACKUP) {
+ qemuBackupJobCancelBlockjobs(vm, priv->backup, true);
+ ret = 0;
+ } else {
+ qemuDomainObjAbortAsyncJob(vm);
+ qemuDomainObjEnterMonitor(driver, vm);
+ ret = qemuMonitorMigrateCancel(priv->mon);
+ if (qemuDomainObjExitMonitor(driver, vm) < 0)
+ ret = -1;
+ }
endjob:
qemuDomainObjEndJob(driver, vm);
--
2.23.0