[PATCH 2/2] qemu: blockjob: Update new job state earlier in qemuBlockJobEventProcessLegacy

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

 



The legacy job handler does not look at the old job state so we can
update it earlier.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_blockjob.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index 097d87f663..08d131ca2b 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -350,9 +350,12 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver,

     qemuBlockJobEmitEvents(driver, vm, disk, job->type, job->newstate);

+    job->state = job->newstate;
+    job->newstate = -1;
+
     /* If we completed a block pull or commit, then update the XML
      * to match.  */
-    switch ((virConnectDomainEventBlockJobStatus) job->newstate) {
+    switch ((virConnectDomainEventBlockJobStatus) job->state) {
     case VIR_DOMAIN_BLOCK_JOB_COMPLETED:
         qemuBlockJobEventProcessLegacyCompleted(driver, vm, job, asyncJob);
         break;
@@ -377,9 +380,6 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver,
         break;
     }

-    job->state = job->newstate;
-    job->newstate = -1;
-
     if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps) < 0)
         VIR_WARN("Unable to save status on vm %s after block job", vm->def->name);
 }
-- 
2.21.0

--
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