[PATCH 2/2] qemu: set jobinfo type to FAILED if job is failed in qemuMigrationRun

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

 



If job is failed in qemuMigrationRun, we expect the jobinfo type as
FAILED. But jobinfo type won't be updated until entering
qemuMigrationWaitForCompletion. We should make it updated in all
conditions.

Signed-off-by: Wang Rui <moon.wangrui@xxxxxxxxxx>
---
 src/qemu/qemu_migration.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index c678ba7..75c77ae 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3723,8 +3723,10 @@ qemuMigrationRun(virQEMUDriverPtr driver,
      * confirm3 step, but need to release the lock state
      */
     if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) {
-        if (qemuMigrationSetOffline(driver, vm) < 0)
+        if (qemuMigrationSetOffline(driver, vm) < 0) {
+            priv->job.current->type = VIR_DOMAIN_JOB_FAILED;
             goto cleanup;
+        }
     }
 
     ret = 0;
@@ -3748,6 +3750,9 @@ qemuMigrationRun(virQEMUDriverPtr driver,
         qemuDomainJobInfoUpdateDowntime(priv->job.completed);
     }
 
+    if (priv->job.current->type == VIR_DOMAIN_JOB_UNBOUNDED)
+        priv->job.current->type = VIR_DOMAIN_JOB_FAILED;
+
     cookieFlags |= QEMU_MIGRATION_COOKIE_NETWORK |
                    QEMU_MIGRATION_COOKIE_STATS;
     if (flags & VIR_MIGRATE_PERSIST_DEST)
-- 
1.7.12.4


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