From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8ThK-0002PF-NA for qemu-devel@nongnu.org; Fri, 16 Mar 2012 05:43:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8ThE-0004cn-Df for qemu-devel@nongnu.org; Fri, 16 Mar 2012 05:43:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22360) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8ThE-0004ce-4o for qemu-devel@nongnu.org; Fri, 16 Mar 2012 05:43:40 -0400 Message-ID: <4F630B44.5000102@redhat.com> Date: Fri, 16 Mar 2012 10:43:32 +0100 From: Paolo Bonzini 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> In-Reply-To: <20120316085453.4947.23068.stgit@amd-6168-8-1.englab.nay.redhat.com> Content-Type: text/plain; charset=UTF-8 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: Jason Wang Cc: aliguori@us.ibm.com, stefanha@linux.vnet.ibm.com, quintela@redhat.com, rusty@rustcorp.com.au, qemu-devel@nongnu.org, mst@redhat.com Il 16/03/2012 09:54, Jason Wang ha scritto: > qemu_announce_self() were moved to vm_start(). This is because we may > want to let guest to send the gratuitous packets. After this change, > we need to check the previous run state (RUN_STATE_INMIGRATE) to > decide whether an announcement is needed. > > Signed-off-by: Jason Wang > --- > migration.c | 1 - > vl.c | 4 ++++ > 2 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/migration.c b/migration.c > index 00fa1e3..1ce6b5c 100644 > --- a/migration.c > +++ b/migration.c > @@ -88,7 +88,6 @@ void process_incoming_migration(QEMUFile *f) > fprintf(stderr, "load of migration failed\n"); > exit(0); > } > - qemu_announce_self(); > DPRINTF("successfully loaded vm state\n"); > > /* Make sure all file formats flush their mutable metadata */ > diff --git a/vl.c b/vl.c > index 65f11f2..4742b1b 100644 > --- a/vl.c > +++ b/vl.c > @@ -1261,11 +1261,15 @@ void vm_state_notify(int running, RunState state) > void vm_start(void) > { > if (!runstate_is_running()) { > + RunState prev_run_state = current_run_state; > cpu_enable_ticks(); > runstate_set(RUN_STATE_RUNNING); > vm_state_notify(1, RUN_STATE_RUNNING); > resume_all_vcpus(); > monitor_protocol_event(QEVENT_RESUME, NULL); > + if (prev_run_state == RUN_STATE_INMIGRATE) { > + qemu_announce_self(); > + } > } > } > > I tihnk this won't work with -S, did you test it? Perhaps it's possible simply to change if (autostart) { vm_start(); } else { runstate_set(RUN_STATE_PRELAUNCH); } to remain in INMIGRATE state: if (autostart) { vm_start(); } Otherwise looks good. Paolo