From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47286) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbS1q-0006ng-CH for qemu-devel@nongnu.org; Tue, 07 Oct 2014 06:30:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbS1g-0007EN-H9 for qemu-devel@nongnu.org; Tue, 07 Oct 2014 06:30:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:24648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbS1g-0007EF-8e for qemu-devel@nongnu.org; Tue, 07 Oct 2014 06:29:52 -0400 Date: Tue, 7 Oct 2014 11:29:38 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20141007102937.GG2404@work-vm> References: <1412358473-31398-1-git-send-email-dgilbert@redhat.com> <1412358473-31398-48-git-send-email-dgilbert@redhat.com> <54303CEF.6060606@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54303CEF.6060606@redhat.com> Subject: Re: [Qemu-devel] [PATCH v4 47/47] End of migration for postcopy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, lilei@linux.vnet.ibm.com, quintela@redhat.com, cristian.klein@cs.umu.se, qemu-devel@nongnu.org, amit.shah@redhat.com, yanghy@cn.fujitsu.com * Paolo Bonzini (pbonzini@redhat.com) wrote: > Il 03/10/2014 19:47, Dr. David Alan Gilbert (git) ha scritto: > > + mis->postcopy_ram_state); > > + if (mis->postcopy_ram_state == POSTCOPY_RAM_INCOMING_ADVISE) { > > + /* > > + * Where a migration had postcopy enabled (and thus went to advise) > > + * but managed to complete within the precopy period > > + */ > > + postcopy_ram_incoming_cleanup(mis); > > + } else { > > + if ((ret >= 0) && > > + (mis->postcopy_ram_state > POSTCOPY_RAM_INCOMING_ADVISE)) { > > Instead of the >, it is perhaps nicer to use an outer if that checks for > state != NONE? Because in fact this check is for state != NONE, having > ADVISE been handled above. You mean something like this (untested) ? if (mis->postcopy_ram_state != POSTCOPY_RAM_INCOMING_NONE) { if (mis->postcopy_ram_state == POSTCOPY_RAM_INCOMING_ADVISE) { /* * Where a migration had postcopy enabled (and thus went to advise) * but managed to complete within the precopy period */ postcopy_ram_incoming_cleanup(mis); } else if (ret >= 0) { /* * Postcopy was started, cleanup should happen at the end of the * postcopy thread. */ DPRINTF("process_incoming_migration_co: exiting main branch"); return; } } Dave > Paolo > > > + /* > > + * Postcopy was started, cleanup should happen at the end of the > > + * postcopy thread. > > + */ > > + DPRINTF("process_incoming_migration_co: exiting main branch"); > > + return; > > + } > > + } > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK