From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFnci-0004yT-1N for qemu-devel@nongnu.org; Mon, 17 Oct 2011 09:53:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFnce-0000ck-4d for qemu-devel@nongnu.org; Mon, 17 Oct 2011 09:53:00 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:62495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFncd-0000cd-QO for qemu-devel@nongnu.org; Mon, 17 Oct 2011 09:52:56 -0400 Received: by ggnr5 with SMTP id r5so3744386ggn.4 for ; Mon, 17 Oct 2011 06:52:55 -0700 (PDT) Message-ID: <4E9C3334.3040700@codemonkey.ws> Date: Mon, 17 Oct 2011 08:52:52 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <839ab5ce6888472e1161b0677cfeed0afa7b8d27.1318326683.git.quintela@redhat.com> In-Reply-To: <839ab5ce6888472e1161b0677cfeed0afa7b8d27.1318326683.git.quintela@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 02/36] migration: simplify state assignmente List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu-devel@nongnu.org On 10/11/2011 05:00 AM, Juan Quintela wrote: > Once there, make sure that if we already know that there is one error, > just call migration_fd_cleanup() with the ERROR state. > > Signed-off-by: Juan Quintela Reviewed-by: Anthony Liguori Regards, Anthony Liguori > --- > migration.c | 11 ++++------- > 1 files changed, 4 insertions(+), 7 deletions(-) > > diff --git a/migration.c b/migration.c > index 77a51ad..7fd6c23 100644 > --- a/migration.c > +++ b/migration.c > @@ -371,7 +371,6 @@ void migrate_fd_put_ready(void *opaque) > > DPRINTF("iterate\n"); > if (qemu_savevm_state_iterate(s->mon, s->file) == 1) { > - int state; > int old_vm_running = runstate_is_running(); > > DPRINTF("done iterating\n"); > @@ -381,20 +380,18 @@ void migrate_fd_put_ready(void *opaque) > if (old_vm_running) { > vm_start(); > } > - state = MIG_STATE_ERROR; > - } else { > - state = MIG_STATE_COMPLETED; > + s->state = MIG_STATE_ERROR; > } > if (migrate_fd_cleanup(s)< 0) { > if (old_vm_running) { > vm_start(); > } > - state = MIG_STATE_ERROR; > + s->state = MIG_STATE_ERROR; > } > - if (state == MIG_STATE_COMPLETED) { > + if (s->state == MIG_STATE_ACTIVE) { > + s->state = MIG_STATE_COMPLETED; > runstate_set(RUN_STATE_POSTMIGRATE); > } > - s->state = state; > notifier_list_notify(&migration_state_notifiers, NULL); > } > }