All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] migration: announce VM's new home just before VM is runnable
@ 2015-10-14 12:07 Amit Shah
  2015-10-14 12:16 ` Michael S. Tsirkin
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Amit Shah @ 2015-10-14 12:07 UTC (permalink / raw)
  To: qemu list
  Cc: Amit Shah, Jason Wang, Michael S. Tsirkin,
	Dr. David Alan Gilbert, Juan Quintela

We were announcing the dest host's IP as our new IP a bit too soon -- if
there were errors detected after this announcement was done, the
migration is failed and the VM could continue running on the src host --
causing problems later.

Move around the qemu_announce_self() call so it's done just before the
VM is runnable.

Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
 migration/migration.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/migration/migration.c b/migration/migration.c
index b7de9b7..ca21ba8 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -295,7 +295,6 @@ static void process_incoming_migration_co(void *opaque)
         exit(EXIT_FAILURE);
     }
     migrate_generate_event(MIGRATION_STATUS_COMPLETED);
-    qemu_announce_self();
 
     /* Make sure all file formats flush their mutable metadata */
     bdrv_invalidate_cache_all(&local_err);
@@ -305,6 +304,12 @@ static void process_incoming_migration_co(void *opaque)
         exit(EXIT_FAILURE);
     }
 
+    /*
+     * This must happen after all error conditions are dealt with and
+     * we're sure the VM is going to be running on this host.
+     */
+    qemu_announce_self();
+
     /* If global state section was not received or we are in running
        state, we need to obey autostart. Any other state is set with
        runstate_set. */
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-10-15  8:20 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-14 12:07 [Qemu-devel] [PATCH 1/1] migration: announce VM's new home just before VM is runnable Amit Shah
2015-10-14 12:16 ` Michael S. Tsirkin
2015-10-14 12:38 ` Dr. David Alan Gilbert
2015-10-14 13:06   ` Amit Shah
2015-10-14 13:21 ` Juan Quintela
2015-10-14 14:12   ` Michael S. Tsirkin
2015-10-15  1:54     ` Jason Wang
2015-10-15  6:01     ` Amit Shah
2015-10-15  6:36       ` Juan Quintela
2015-10-15  8:04         ` Amit Shah
2015-10-15  8:19           ` Michael S. Tsirkin
2015-10-15  1:50 ` Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.