From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zmk7k-00033z-Cm for qemu-devel@nongnu.org; Thu, 15 Oct 2015 11:07:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zmk7h-0001d6-6c for qemu-devel@nongnu.org; Thu, 15 Oct 2015 11:07:20 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:55627) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zmk7g-0001cw-Te for qemu-devel@nongnu.org; Thu, 15 Oct 2015 11:07:17 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Oct 2015 16:07:14 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 019F52190063 for ; Thu, 15 Oct 2015 16:07:09 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t9FF7ARj35324090 for ; Thu, 15 Oct 2015 15:07:10 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t9FF7Aff018774 for ; Thu, 15 Oct 2015 09:07:10 -0600 References: <1444890480-6371-1-git-send-email-quintela@redhat.com> <1444890480-6371-2-git-send-email-quintela@redhat.com> From: Christian Borntraeger Message-ID: <561FC11E.1000206@de.ibm.com> Date: Thu, 15 Oct 2015 17:07:10 +0200 MIME-Version: 1.0 In-Reply-To: <1444890480-6371-2-git-send-email-quintela@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PULL 1/3] Migration: Generate the completed event only when we complete List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela , qemu-devel@nongnu.org Cc: amit.shah@redhat.com, dgilbert@redhat.com Am 15.10.2015 um 08:27 schrieb Juan Quintela: > From: "Dr. David Alan Gilbert" > > The current migration-completed event is generated a bit too early, > which means that an eager libvirt that's ready to go as soon > as it sees the event ends up racing with the actual end of migration. > > This corresponds to RH bug: > https://bugzilla.redhat.com/show_bug.cgi?id=1271145 Is that something for stable? > > Signed-off-by: Dr. David Alan Gilbert > Reviewed-by: Juan Quintela > Reviewed-by: Amit Shah > xSigned-off-by: Juan Quintela > --- > migration/migration.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/migration/migration.c b/migration/migration.c > index b7de9b7..3d40f24 100644 > --- a/migration/migration.c > +++ b/migration/migration.c > @@ -294,12 +294,12 @@ static void process_incoming_migration_co(void *opaque) > migrate_decompress_threads_join(); > exit(EXIT_FAILURE); > } > - migrate_generate_event(MIGRATION_STATUS_COMPLETED); > qemu_announce_self(); > > /* Make sure all file formats flush their mutable metadata */ > bdrv_invalidate_cache_all(&local_err); > if (local_err) { > + migrate_generate_event(MIGRATION_STATUS_FAILED); > error_report_err(local_err); > migrate_decompress_threads_join(); > exit(EXIT_FAILURE); > @@ -320,6 +320,12 @@ static void process_incoming_migration_co(void *opaque) > runstate_set(global_state_get_runstate()); > } > migrate_decompress_threads_join(); > + /* > + * This must happen after any state changes since as soon as an external > + * observer sees this event they might start to prod at the VM assuming > + * it's ready to use. > + */ > + migrate_generate_event(MIGRATION_STATUS_COMPLETED); > } > > void process_incoming_migration(QEMUFile *f) >