From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZACWl-0002WG-50 for qemu-devel@nongnu.org; Wed, 01 Jul 2015 03:33:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZACWf-0002lo-Uy for qemu-devel@nongnu.org; Wed, 01 Jul 2015 03:33:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZACWf-0002lk-PP for qemu-devel@nongnu.org; Wed, 01 Jul 2015 03:33:45 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 409E7B66A7 for ; Wed, 1 Jul 2015 07:33:45 +0000 (UTC) From: Juan Quintela In-Reply-To: <20150618104614.GF2248@work-vm> (David Alan Gilbert's message of "Thu, 18 Jun 2015 11:46:15 +0100") References: <1434505833-11234-1-git-send-email-quintela@redhat.com> <1434505833-11234-9-git-send-email-quintela@redhat.com> <20150618104614.GF2248@work-vm> Date: Wed, 01 Jul 2015 09:33:43 +0200 Message-ID: <87egks49ig.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 08/11] migration: Use always helper to set state Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: amit.shah@redhat.com, qemu-devel@nongnu.org "Dr. David Alan Gilbert" wrote: > * 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. Force state to be NONE in a different patch, see new series. > > 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