From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37908) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrPsg-00072U-EP for qemu-devel@nongnu.org; Tue, 25 Jun 2013 05:49:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrPse-000292-J4 for qemu-devel@nongnu.org; Tue, 25 Jun 2013 05:49:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrPse-00028i-9H for qemu-devel@nongnu.org; Tue, 25 Jun 2013 05:49:44 -0400 From: Juan Quintela In-Reply-To: <1372125485-11795-15-git-send-email-mrhines@linux.vnet.ibm.com> (mrhines@linux.vnet.ibm.com's message of "Mon, 24 Jun 2013 21:58:04 -0400") References: <1372125485-11795-1-git-send-email-mrhines@linux.vnet.ibm.com> <1372125485-11795-15-git-send-email-mrhines@linux.vnet.ibm.com> Date: Tue, 25 Jun 2013 11:49:38 +0200 Message-ID: <8761x21pvx.fsf@elfo.elfo> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v11 14/15] rdma: introduce MIG_STATE_NONE and change MIG_STATE_SETUP state transition Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mrhines@linux.vnet.ibm.com Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, owasserm@redhat.com, abali@us.ibm.com, mrhines@us.ibm.com, gokul@us.ibm.com, pbonzini@redhat.com, chegu_vinod@hp.com, knoel@redhat.com mrhines@linux.vnet.ibm.com wrote: > From: "Michael R. Hines" > > As described in the previous patch, until now, the MIG_STATE_SETUP > state was not really a 'formal' state. It has been used as a 'zero' state > (what we're calling 'NONE' here) and QEMU has been unconditionally transitioning > into this state when the QMP migration command was called. Instead we want to > introduce MIG_STATE_NONE, which is our starting state in the state machine, and > then immediately transition into the MIG_STATE_SETUP state when the QMP migrate > command is issued. > > In order to do this, we must delay the transition into MIG_STATE_ACTIVE until > later in the migration_thread(). This is done to be able to timestamp the amount of > time spent in the SETUP state for proper accounting to the user during > an RDMA migration. > > Furthermore, the management software, until now, has never been aware of the > existence of the SETUP state whatsoever. This must change, because, timing of this > state implies that the state actually exists. > > These two patches cannot be separated because the 'query_migrate' QMP > switch statement needs to know how to handle this new state transition. > > Tested-by: Michael R. Hines > Signed-off-by: Michael R. Hines > @@ -316,6 +321,7 @@ static void migrate_fd_cancel(MigrationState *s) > { > DPRINTF("cancelling migration\n"); > > + migrate_set_state(s, MIG_STATE_SETUP, MIG_STATE_CANCELLED); > migrate_set_state(s, MIG_STATE_ACTIVE, MIG_STATE_CANCELLED); > } This chunk is wrong. we can call qme_migrate_cancel() at any point, and it is going to be called normally from MIG_STATE_ACTIVE. migrate_set_satet(s, s->state, MIG_STATE_CANCELLED) should do the trick. Or something like that, what do you think? Later, Juan.