mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-23 13:05:27 +00:00
qemu: driver: Split out cancellation of migration from qemuDomainAbortJob
Following patch will refactor qemuDomainAbortJob to use a per-job-type switch where we will need to abort a migration job in various branches. Save some code duplication by introducing a helper. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
fe5841c3bb
commit
4ef3401eb8
@ -13996,6 +13996,24 @@ qemuDomainGetJobStats(virDomainPtr dom,
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
qemuDomainAbortJobMigration(virDomainObjPtr vm)
|
||||
{
|
||||
qemuDomainObjPrivatePtr priv = vm->privateData;
|
||||
int ret;
|
||||
|
||||
VIR_DEBUG("Cancelling migration job at client request");
|
||||
|
||||
qemuDomainObjAbortAsyncJob(vm);
|
||||
qemuDomainObjEnterMonitor(priv->driver, vm);
|
||||
ret = qemuMonitorMigrateCancel(priv->mon);
|
||||
if (qemuDomainObjExitMonitor(priv->driver, vm) < 0)
|
||||
ret = -1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int qemuDomainAbortJob(virDomainPtr dom)
|
||||
{
|
||||
virQEMUDriverPtr driver = dom->conn->privateData;
|
||||
@ -14047,12 +14065,7 @@ static int qemuDomainAbortJob(virDomainPtr dom)
|
||||
goto endjob;
|
||||
}
|
||||
|
||||
VIR_DEBUG("Cancelling job at client request");
|
||||
qemuDomainObjAbortAsyncJob(vm);
|
||||
qemuDomainObjEnterMonitor(driver, vm);
|
||||
ret = qemuMonitorMigrateCancel(priv->mon);
|
||||
if (qemuDomainObjExitMonitor(driver, vm) < 0)
|
||||
ret = -1;
|
||||
ret = qemuDomainAbortJobMigration(vm);
|
||||
|
||||
endjob:
|
||||
qemuDomainObjEndJob(driver, vm);
|
||||
|
Loading…
x
Reference in New Issue
Block a user