[PATCH v4 09/13] qemu: start all async job with job status active

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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    | 2 --
 src/qemu/qemu_migration.c | 4 ----
 src/qemu/qemu_process.c   | 4 ----
 4 files changed, 1 insertion(+), 10 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 9a34cb8..f0c24cc 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -4072,6 +4072,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 c8f916c..4357317 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -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;
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index a1923c3..ff5e1f5 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -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;
 }
 
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index ef4972c..ab81d65 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -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;
 }
 
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux