From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54904) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEc1P-0003VX-TU for qemu-devel@nongnu.org; Mon, 13 Jul 2015 07:35:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEc1O-0002B1-UV for qemu-devel@nongnu.org; Mon, 13 Jul 2015 07:35:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEc1O-0002Am-OP for qemu-devel@nongnu.org; Mon, 13 Jul 2015 07:35:42 -0400 From: Juan Quintela In-Reply-To: <1434450415-11339-25-git-send-email-dgilbert@redhat.com> (David Alan Gilbert's message of "Tue, 16 Jun 2015 11:26:37 +0100") References: <1434450415-11339-1-git-send-email-dgilbert@redhat.com> <1434450415-11339-25-git-send-email-dgilbert@redhat.com> Date: Mon, 13 Jul 2015 13:35:38 +0200 Message-ID: <87r3ocjnn9.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v7 24/42] Add qemu_savevm_state_complete_postcopy Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" 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 "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 > @@ -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? Later, Juan.