提交 4ef3401e 编写于 作者: P Peter Krempa

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: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
上级 fe5841c3
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册