From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9T1q-0002KH-LK for qemu-devel@nongnu.org; Sun, 18 Mar 2012 23:13:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9T1o-0007Aq-Pl for qemu-devel@nongnu.org; Sun, 18 Mar 2012 23:13:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54724) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9T1o-0007Ae-HH for qemu-devel@nongnu.org; Sun, 18 Mar 2012 23:13:00 -0400 Message-ID: <4F66A435.8020402@redhat.com> Date: Mon, 19 Mar 2012 11:12:53 +0800 From: Jason Wang MIME-Version: 1.0 References: <20120316085237.4947.53556.stgit@amd-6168-8-1.englab.nay.redhat.com> <20120316085453.4947.23068.stgit@amd-6168-8-1.englab.nay.redhat.com> <4F630B44.5000102@redhat.com> <4F63125A.1020005@redhat.com> <4F6319DE.1070407@redhat.com> <4F635B0E.7020300@redhat.com> <4F636AFB.9090707@redhat.com> In-Reply-To: <4F636AFB.9090707@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [V5 PATCH 1/4] net: announce self after vm start List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, mst@redhat.com, rusty@rustcorp.com.au, qemu-devel@nongnu.org, quintela@redhat.com On 03/17/2012 12:31 AM, Paolo Bonzini wrote: > Il 16/03/2012 16:23, Jason Wang ha scritto: >>> Or just a global need_announce instead of looking at the runstate. >>> >>> Paolo >>> >> Then I think it's better for us introduce a parameter for vm_start() >> like what we've done in V4. > But that didn't work because you ended up changing the "cont" semantics. > > There are two possibilities. > > 1) Changing those is okay, in which case you only need to check more > runstates; > > 2) Changing those is not okay, in which case you need something like > this in qemu_announce_self() > > void qemu_announce_self() > { > if (!runstate_is_running()) { > need_announce = true; > return; > } > > need_announce = false; > ... > } > > and then you just check need_announce in vm_start. Nothing to change in > all the invocations of vm_start, you just mark that you need to do work > later. > > Paolo Right, I would replace the qemu_announce_self() with a "need_announce = true" in process_incoming_migration() and check it later in vm_start(). Thanks