From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zmdla-0004h3-A2 for qemu-devel@nongnu.org; Thu, 15 Oct 2015 04:20:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmdlW-0003ER-F6 for qemu-devel@nongnu.org; Thu, 15 Oct 2015 04:20:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmdlW-0003EN-7v for qemu-devel@nongnu.org; Thu, 15 Oct 2015 04:19:58 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 87750C0BB2AA for ; Thu, 15 Oct 2015 08:19:57 +0000 (UTC) Date: Thu, 15 Oct 2015 11:19:53 +0300 From: "Michael S. Tsirkin" Message-ID: <20151015111733-mutt-send-email-mst@redhat.com> References: <18ab6aea9a24a21bf2686a2ab220434951d53dc0.1444824439.git.amit.shah@redhat.com> <87r3kxpovo.fsf@neno.neno> <20151014165126-mutt-send-email-mst@redhat.com> <20151015060148.GC31081@grmbl.mre> <87zizkr62m.fsf@neno.neno> <20151015080410.GD31081@grmbl.mre> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151015080410.GD31081@grmbl.mre> 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 Thu, Oct 15, 2015 at 01:34:10PM +0530, Amit Shah wrote: > On (Thu) 15 Oct 2015 [08:36:49], Juan Quintela wrote: > > Amit Shah wrote: > > > On (Wed) 14 Oct 2015 [17:12:44], Michael S. Tsirkin wrote: > > >> On Wed, Oct 14, 2015 at 03:21:15PM +0200, Juan Quintela wrote: > > >> > 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 > > >> > > > >> > Reviewed-by: Juan Quintela > > >> > > > >> > applied. > > >> > > > >> > I have the same question than Dave, but also agree that this is a > > >> > movement in the right direction. > > >> > > > >> > Why it is not only needed when we do a vm_start()? > > >> > > >> It's a complex question. We don't want to do this on each > > >> vmstop/vmcont. But maybe we want to, on the 1st vmstart after > > >> qemu is started. > > > > > > Why? When a guest starts, it will issue ARP requests and everything > > > will just work. We need this announce_self only to tell the switches > > > that the MAC belonging to the guest's IP has changed.. > > > > What happens if we stop a guest on one host and we start it on a > > different host? > > So the migration code doesn't get involved? IOW, we don't call > qemu_announce_self() at all? I'd say that's a corner case: we provide > live migration capability which sets up things fine; if people choose > to use something else, they have to do their own setup. I agree it's not a big deal. Still, if someone is inclined to always announce self on first vm start, that would also be OK. > > If the communication is started from a different place, packets will go > > to old host, until some TCP timeout happens, right? > > Yes, packets from remote will keep going to the old host. If the old > host has since closed the qemu process, it will give tcp errors to the > remote, and the remote will in time shut down its sockets. Also, when > the VM sends out any packets, switches could adjust their tables and > send remote packets to the new host. Depends on how smart the > switches are. > > > Amit