From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAEKQ-0006Sn-Q2 for qemu-devel@nongnu.org; Wed, 01 Jul 2015 05:29:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAEKK-0001Yq-V8 for qemu-devel@nongnu.org; Wed, 01 Jul 2015 05:29:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAEKK-0001Yf-PS for qemu-devel@nongnu.org; Wed, 01 Jul 2015 05:29:08 -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 7418D8E7B2 for ; Wed, 1 Jul 2015 09:29:08 +0000 (UTC) Date: Wed, 1 Jul 2015 10:29:04 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20150701092904.GE2137@work-vm> References: <1435740693-10839-1-git-send-email-quintela@redhat.com> <1435740693-10839-9-git-send-email-quintela@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435740693-10839-9-git-send-email-quintela@redhat.com> Subject: Re: [Qemu-devel] [PATCH 08/12] migration: ensure we start in NONE state 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: > Signed-off-by: Juan Quintela > --- > migration/migration.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/migration/migration.c b/migration/migration.c > index cfcc227..c5b778b 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -693,7 +693,6 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, > error_setg(errp, QERR_MIGRATION_ACTIVE); > return; > } > - > if (runstate_check(RUN_STATE_INMIGRATE)) { > error_setg(errp, "Guest is waiting for an incoming migration"); > return; > @@ -708,6 +707,12 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, > return; > } > > + /* We are starting a new migration, so we want to start in a clean > + state. This change is only needed if previous migration > + failed/was cancelled. We don't use migrate_set_state() because > + we are setting the initial state, not changing it. */ > + s->state = MIGRATION_STATUS_NONE; > + Yes, I think that should work; we've already checked which state we're in, so we can't already be running a migration at this point, and this would be run from the main thread. Reviewed-by: Dr. David Alan Gilbert > s = migrate_init(¶ms); > > if (strstart(uri, "tcp:", &p)) { > -- > 2.4.3 > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK