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.
---
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_driver.c | 3 ---
src/qemu/qemu_migration.c | 5 -----
src/qemu/qemu_process.c | 3 ---
4 files changed, 1 insertion(+), 11 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index ba331dc..2a14499 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3622,6 +3622,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();
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e65448f..3854a41 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3138,7 +3138,6 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
bool was_running = false;
int ret = -1;
virObjectEventPtr event = NULL;
- qemuDomainObjPrivatePtr priv = vm->privateData;
virCapsPtr caps;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
@@ -3156,8 +3155,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;
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 1760908..388f770 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1518,7 +1518,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)
@@ -5575,8 +5574,6 @@ qemuMigrationJobStart(virQEMUDriverPtr driver,
virDomainObjPtr vm,
qemuDomainAsyncJob job)
{
- qemuDomainObjPrivatePtr priv = vm->privateData;
-
if (qemuDomainObjBeginAsyncJob(driver, vm, job) < 0)
return -1;
@@ -5588,8 +5585,6 @@ qemuMigrationJobStart(virQEMUDriverPtr driver,
JOB_MASK(QEMU_JOB_MIGRATION_OP)));
}
- priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
-
return 0;
}
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 42cb0d4..f5cd00b 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -4145,13 +4145,10 @@ int
qemuProcessBeginJob(virQEMUDriverPtr driver,
virDomainObjPtr vm)
{
- qemuDomainObjPrivatePtr priv = vm->privateData;
-
if (qemuDomainObjBeginAsyncJob(driver, vm, QEMU_ASYNC_JOB_START) < 0)
return -1;
qemuDomainObjSetAsyncJobMask(vm, QEMU_JOB_NONE);
- priv->job.current->status = QEMU_DOMAIN_JOB_STATUS_ACTIVE;
return 0;
}
--
1.8.3.1