From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmKsP-00042T-9F for qemu-devel@nongnu.org; Wed, 14 Oct 2015 08:09:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmKsK-0006Zg-8r for qemu-devel@nongnu.org; Wed, 14 Oct 2015 08:09:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37387) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmKsK-0006ZY-3O for qemu-devel@nongnu.org; Wed, 14 Oct 2015 08:09:44 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 457C4C0BB2B7 for ; Wed, 14 Oct 2015 12:09:43 +0000 (UTC) From: Amit Shah Date: Wed, 14 Oct 2015 17:37:19 +0530 Message-Id: <18ab6aea9a24a21bf2686a2ab220434951d53dc0.1444824439.git.amit.shah@redhat.com> Subject: [Qemu-devel] [PATCH 1/1] migration: announce VM's new home just before VM is runnable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- 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