[PATCH v2 11/15] qemu: Don't kill running migrated domain on daemon restart

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

 



When destination libvirtd is restarted during migration in Finish phase
just after the point we started guest CPUs, we should not kill the
domain.

Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
---

Notes:
    Version 2:
    - no change

 src/qemu/qemu_process.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 5ced279..879cd12 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3304,9 +3304,13 @@ qemuProcessRecoverMigration(virQEMUDriverPtr driver,
 
         case QEMU_MIGRATION_PHASE_FINISH3:
             /* migration finished, we started resuming the domain but didn't
-             * confirm success or failure yet; killing it seems safest */
-            VIR_DEBUG("Killing migrated domain %s", vm->def->name);
-            return -1;
+             * confirm success or failure yet; killing it seems safest unless
+             * we already started guest CPUs */
+            if (state != VIR_DOMAIN_RUNNING) {
+                VIR_DEBUG("Killing migrated domain %s", vm->def->name);
+                return -1;
+            }
+            break;
         }
     } else if (job == QEMU_ASYNC_JOB_MIGRATION_OUT) {
         switch (phase) {
-- 
2.7.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]