From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zly8h-0004J0-VI for qemu-devel@nongnu.org; Tue, 13 Oct 2015 07:53:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zly8d-00062u-SB for qemu-devel@nongnu.org; Tue, 13 Oct 2015 07:53:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zly8d-00062T-Ml for qemu-devel@nongnu.org; Tue, 13 Oct 2015 07:53:03 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 9C3D9303E24 for ; Tue, 13 Oct 2015 11:53:02 +0000 (UTC) From: Juan Quintela In-Reply-To: <20151013113809.GA31081@grmbl.mre> (Amit Shah's message of "Tue, 13 Oct 2015 17:08:09 +0530") References: <1444735287-18562-1-git-send-email-dgilbert@redhat.com> <20151013113809.GA31081@grmbl.mre> Date: Tue, 13 Oct 2015 13:53:00 +0200 Message-ID: <87a8rn2der.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] Migration: Generate the completed event only when we complete Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Amit Shah Cc: jdenemar@redhat.com, "Dr. David Alan Gilbert (git)" , qemu-devel@nongnu.org Amit Shah wrote: > On (Tue) 13 Oct 2015 [12:21:27], Dr. David Alan Gilbert (git) wrote: >> 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 >> >> Signed-off-by: Dr. David Alan Gilbert > > Reviewed-by: Amit Shah > >> 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(); > > Related in this context (but independent of this patch): this > announce_self should happen after we're through with all the error > cases: we don't want to announce our new IP and end up having run on > src due to a failed migration. Yeap, sounds very reasonable. > >> /* 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); > > Amit