From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:47633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8UAa-0002zU-0D for qemu-devel@nongnu.org; Fri, 16 Mar 2012 06:14:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8UAR-0001u8-Jl for qemu-devel@nongnu.org; Fri, 16 Mar 2012 06:13:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54319) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8UAR-0001u2-Al for qemu-devel@nongnu.org; Fri, 16 Mar 2012 06:13:51 -0400 Message-ID: <4F63125A.1020005@redhat.com> Date: Fri, 16 Mar 2012 18:13:46 +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> In-Reply-To: <4F630B44.5000102@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, quintela@redhat.com, rusty@rustcorp.com.au, qemu-devel@nongnu.org, mst@redhat.com On 03/16/2012 05:43 PM, Paolo Bonzini wrote: > 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 Yes, it does not work. > > if (autostart) { > vm_start(); > } else { > runstate_set(RUN_STATE_PRELAUNCH); > } > > to remain in INMIGRATE state: > > if (autostart) { > vm_start(); > } > > Otherwise looks good. > > Paolo The problem with staying in the INMIGRATE is that we can not figure out when the migration is completed when using '-S', so this kind of transition were forbidden by qmp_cont(). Looks like we need a new state such as RUN_STATE_MIGRATE_PRELAUNCH?