From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49156) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDWGB-0008Cr-NG for qemu-devel@nongnu.org; Thu, 07 Mar 2013 03:33:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDWG9-0007j6-ED for qemu-devel@nongnu.org; Thu, 07 Mar 2013 03:33:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49857) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDWG9-0007iy-71 for qemu-devel@nongnu.org; Thu, 07 Mar 2013 03:33:05 -0500 From: Jason Wang Date: Thu, 7 Mar 2013 16:23:48 +0800 Message-Id: <1362644631-23113-3-git-send-email-jasowang@redhat.com> In-Reply-To: <1362644631-23113-1-git-send-email-jasowang@redhat.com> References: <1362644631-23113-1-git-send-email-jasowang@redhat.com> Subject: [Qemu-devel] [PATCH V7 2/5] net: announce self after vm is started List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aliguori@us.ibm.com, pbonzini@redhat.com, owasserm@redhat.com, qemu-devel@nongnu.org Cc: Jason Wang , mst@redhat.com Since we may want to send garp by guest if guest driver is capable of it. We need trigger this event after vm is started. So this patch do this when the state is changing from RUN_STATE_PRELAUNCH_MIGRATE to RUN_STATE_RUNINNG. 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 ecdf2c5..3599d2d 100644 --- a/migration.c +++ b/migration.c @@ -100,7 +100,6 @@ static void process_incoming_migration_co(void *opaque) fprintf(stderr, "load of migration failed\n"); exit(0); } - qemu_announce_self(); DPRINTF("successfully loaded vm state\n"); bdrv_clear_incoming_migration_all(); diff --git a/vl.c b/vl.c index 5dd2e0e..ccf6ea7 100644 --- a/vl.c +++ b/vl.c @@ -1681,11 +1681,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_PRELAUNCH_MIGRATE) { + qemu_announce_self(); + } } } -- 1.7.1