From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmKyc-0007mO-Su for qemu-devel@nongnu.org; Wed, 14 Oct 2015 08:16:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmKyX-0000Dd-MT for qemu-devel@nongnu.org; Wed, 14 Oct 2015 08:16:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmKyX-0000DO-GY for qemu-devel@nongnu.org; Wed, 14 Oct 2015 08:16:09 -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 1ADF332C414 for ; Wed, 14 Oct 2015 12:16:08 +0000 (UTC) Date: Wed, 14 Oct 2015 15:16:03 +0300 From: "Michael S. Tsirkin" Message-ID: <20151014151526-mutt-send-email-mst@redhat.com> References: <18ab6aea9a24a21bf2686a2ab220434951d53dc0.1444824439.git.amit.shah@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18ab6aea9a24a21bf2686a2ab220434951d53dc0.1444824439.git.amit.shah@redhat.com> Subject: Re: [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: Amit Shah Cc: Jason Wang , qemu list , "Dr. David Alan Gilbert" , Juan Quintela On Wed, Oct 14, 2015 at 05:37:19PM +0530, Amit Shah wrote: > 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 Acked-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin > --- > 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