From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5XRi-00070O-HC for qemu-devel@nongnu.org; Thu, 18 Jun 2015 06:53:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5XRd-0001Xs-Qp for qemu-devel@nongnu.org; Thu, 18 Jun 2015 06:53:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5XRd-0001Xc-Lq for qemu-devel@nongnu.org; Thu, 18 Jun 2015 06:53:17 -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 CF69B36992C for ; Thu, 18 Jun 2015 10:53:16 +0000 (UTC) Date: Thu, 18 Jun 2015 11:53:13 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20150618105312.GH2248@work-vm> References: <1434505833-11234-1-git-send-email-quintela@redhat.com> <1434505833-11234-12-git-send-email-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1434505833-11234-12-git-send-email-quintela@redhat.com> Subject: Re: [Qemu-devel] [PATCH 11/11] migration: Add migration events on target side List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: amit.shah@redhat.com, qemu-devel@nongnu.org * Juan Quintela (quintela@redhat.com) wrote: > We reuse the migration events from the source side, sending them on the > appropiate place. > > Signed-off-by: Juan Quintela > Reviewed-by: Eric Blake > --- > migration/migration.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/migration/migration.c b/migration/migration.c > index 3637d36..2b4fd55 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -218,6 +218,7 @@ void qemu_start_incoming_migration(const char *uri, Error **errp) > { > const char *p; > > + qapi_event_send_migration(MIGRATION_STATUS_SETUP, &error_abort); Try and avoid error_abort - you don't want to trigger an assert (and associated core etc) if it's just something like the monitor disconnecting. (And anyway in this case you have an errp). Dave > if (!strcmp(uri, "defer")) { > deferred_incoming_migration(errp); > } else if (strstart(uri, "tcp:", &p)) { > @@ -246,7 +247,7 @@ static void process_incoming_migration_co(void *opaque) > int ret; > > migration_incoming_state_new(f); > - > + qapi_event_send_migration(MIGRATION_STATUS_ACTIVE, &error_abort); > ret = qemu_loadvm_state(f); > > qemu_fclose(f); > @@ -254,10 +255,12 @@ static void process_incoming_migration_co(void *opaque) > migration_incoming_state_destroy(); > > if (ret < 0) { > + qapi_event_send_migration(MIGRATION_STATUS_FAILED, &error_abort); > error_report("load of migration failed: %s", strerror(-ret)); > migrate_decompress_threads_join(); > exit(EXIT_FAILURE); > } > + qapi_event_send_migration(MIGRATION_STATUS_COMPLETED, &error_abort); > qemu_announce_self(); > > /* Make sure all file formats flush their mutable metadata */ > -- > 2.4.3 > > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK