From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5XKy-0000pk-8a for qemu-devel@nongnu.org; Thu, 18 Jun 2015 06:46:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5XKu-0005im-0B for qemu-devel@nongnu.org; Thu, 18 Jun 2015 06:46:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5XKt-0005iZ-RC for qemu-devel@nongnu.org; Thu, 18 Jun 2015 06:46:19 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 4E7672B51A1 for ; Thu, 18 Jun 2015 10:46:19 +0000 (UTC) Date: Thu, 18 Jun 2015 11:46:15 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20150618104614.GF2248@work-vm> References: <1434505833-11234-1-git-send-email-quintela@redhat.com> <1434505833-11234-9-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-9-git-send-email-quintela@redhat.com> Subject: Re: [Qemu-devel] [PATCH 08/11] migration: Use always helper to set 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: > There were three places that were not using the migrate_set_state() > helper, just fix that. > > Signed-off-by: Juan Quintela > --- > migration/migration.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/migration/migration.c b/migration/migration.c > index 1791185..1c84249 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -545,7 +545,7 @@ void migrate_fd_error(MigrationState *s) > { > trace_migrate_fd_error(); > assert(s->file == NULL); > - s->state = MIGRATION_STATUS_FAILED; > + migrate_set_state(s, MIGRATION_STATUS_SETUP, MIGRATION_STATUS_FAILED); > trace_migrate_set_state(MIGRATION_STATUS_FAILED); > notifier_list_notify(&migration_state_notifiers, s); > } > @@ -630,7 +630,7 @@ static MigrationState *migrate_init(const MigrationParams *params) > s->parameters[MIGRATION_PARAMETER_DECOMPRESS_THREADS] = > decompress_thread_count; > s->bandwidth_limit = bandwidth_limit; > - s->state = MIGRATION_STATUS_SETUP; > + migrate_set_state(s, MIGRATION_STATUS_NONE, MIGRATION_STATUS_SETUP); > trace_migrate_set_state(MIGRATION_STATUS_SETUP); Does that work if you do a migrate, cancel it and then migrate again? I think the status would be MIGRATION_STATUS_CANCELLED at that point. Dave > > s->total_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); > @@ -723,7 +723,7 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, > #endif > } else { > error_set(errp, QERR_INVALID_PARAMETER_VALUE, "uri", "a valid migration protocol"); > - s->state = MIGRATION_STATUS_FAILED; > + migrate_set_state(s, MIGRATION_STATUS_SETUP, MIGRATION_STATUS_FAILED); > return; > } > > -- > 2.4.3 > > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK