From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40417) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEfk1-0000I7-H4 for qemu-devel@nongnu.org; Mon, 13 Jul 2015 11:34:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEfjx-0007Ni-QT for qemu-devel@nongnu.org; Mon, 13 Jul 2015 11:34:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEfjx-0007Md-LW for qemu-devel@nongnu.org; Mon, 13 Jul 2015 11:33:57 -0400 Date: Mon, 13 Jul 2015 16:33:50 +0100 From: "Dr. David Alan Gilbert" Message-ID: <20150713153350.GG2492@work-vm> References: <1434450415-11339-1-git-send-email-dgilbert@redhat.com> <1434450415-11339-25-git-send-email-dgilbert@redhat.com> <87r3ocjnn9.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87r3ocjnn9.fsf@neno.neno> Subject: Re: [Qemu-devel] [PATCH v7 24/42] Add qemu_savevm_state_complete_postcopy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, liang.z.li@intel.com, qemu-devel@nongnu.org, luis@cs.umu.se, amit.shah@redhat.com, pbonzini@redhat.com, david@gibson.dropbear.id.au * Juan Quintela (quintela@redhat.com) wrote: > "Dr. David Alan Gilbert (git)" wrote: > > From: "Dr. David Alan Gilbert" > > > > Add qemu_savevm_state_complete_postcopy to complement > > qemu_savevm_state_complete_precopy together with a new > > save_live_complete_postcopy method on devices. > > > > The save_live_complete_precopy method is called on > > all devices during a precopy migration, and all non-postcopy > > devices during a postcopy migration at the transition. > > > > The save_live_complete_postcopy method is called at > > the end of postcopy for all postcopiable devices. > > > > Signed-off-by: Dr. David Alan Gilbert > > Reviewed-by: Juan Quintela Thanks. > > > @@ -947,13 +987,15 @@ void qemu_savevm_state_complete_precopy(QEMUFile *f) > > int vmdesc_len; > > SaveStateEntry *se; > > int ret; > > + bool in_postcopy = migration_postcopy_phase(migrate_get_current()); > > > > trace_savevm_state_complete_precopy(); > > > > cpu_synchronize_all_states(); > > > > QTAILQ_FOREACH(se, &savevm_state.handlers, entry) { > > - if (!se->ops || !se->ops->save_live_complete_precopy) { > > + if (!se->ops || !se->ops->save_live_complete_precopy || > > + (in_postcopy && se->ops->save_live_complete_postcopy)) { > > continue; > > } > > I would change the formatting to something like: > > if (!se->ops || > (in_postcopy && se->ops->save_live_complete_postcopy) > !se->ops->save_live_complete_precopy) { > continue > } > > Just to make easier to see when we exit? Done Dave (Starting with the easy fix first :-) > > Later, Juan. -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK