提交 b6868c3c 编写于 作者: N Nikolay Shirokovskiy 提交者: Jiri Denemark

qemu: start all async job with job status active

Setting status to none has little value - getting job status
will not return even elapsed time.

After this patch getting job stats stays correct in a sence
it will not fetch migration stats because it consults
stats.status before doing the fetch.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 78107f85
......@@ -4079,6 +4079,7 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver,
qemuDomainObjResetAsyncJob(priv);
if (VIR_ALLOC(priv->job.current) < 0)
goto cleanup;
priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
priv->job.asyncJob = asyncJob;
priv->job.asyncOwner = virThreadSelfID();
priv->job.asyncOwnerAPI = virThreadJobGet();
......
......@@ -3310,8 +3310,6 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
goto endjob;
}
priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
/* Pause */
if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
was_running = true;
......
......@@ -1548,7 +1548,6 @@ qemuMigrationWaitForCompletion(virQEMUDriverPtr driver,
bool events = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT);
int rv;
jobInfo->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
while ((rv = qemuMigrationCompleted(driver, vm, asyncJob,
dconn, flags)) != 1) {
if (rv < 0)
......@@ -5611,7 +5610,6 @@ qemuMigrationJobStart(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuDomainAsyncJob job)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
virDomainJobOperation op;
unsigned long long mask;
......@@ -5629,8 +5627,6 @@ qemuMigrationJobStart(virQEMUDriverPtr driver,
return -1;
qemuDomainObjSetAsyncJobMask(vm, mask);
priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
return 0;
}
......
......@@ -3993,15 +3993,11 @@ qemuProcessBeginJob(virQEMUDriverPtr driver,
virDomainObjPtr vm,
virDomainJobOperation operation)
{
qemuDomainObjPrivatePtr priv = vm->privateData;
if (qemuDomainObjBeginAsyncJob(driver, vm, QEMU_ASYNC_JOB_START,
operation) < 0)
return -1;
qemuDomainObjSetAsyncJobMask(vm, QEMU_JOB_NONE);
priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册