From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr9SG-0002X5-3M for qemu-devel@nongnu.org; Wed, 19 Nov 2014 12:54:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xr9SC-0007SK-3o for qemu-devel@nongnu.org; Wed, 19 Nov 2014 12:54:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50494) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xr9SB-0007SF-Pm for qemu-devel@nongnu.org; Wed, 19 Nov 2014 12:54:07 -0500 Date: Wed, 19 Nov 2014 17:53:54 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20141119175353.GO2355@work-vm> References: <1412358473-31398-1-git-send-email-dgilbert@redhat.com> <1412358473-31398-25-git-send-email-dgilbert@redhat.com> <20141104013348.GE27321@voom.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141104013348.GE27321@voom.fritz.box> Subject: Re: [Qemu-devel] [PATCH v4 24/47] Allow savevm handlers to state whether they could go into postcopy List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, quintela@redhat.com, cristian.klein@cs.umu.se, qemu-devel@nongnu.org, amit.shah@redhat.com, yanghy@cn.fujitsu.com * David Gibson (david@gibson.dropbear.id.au) wrote: > On Fri, Oct 03, 2014 at 06:47:30PM +0100, Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > Use that to split the qemu_savevm_state_pending counts into postcopiable > > and non-postcopiable amounts > > > > Signed-off-by: Dr. David Alan Gilbert > > --- > > arch_init.c | 7 +++++++ > > include/migration/vmstate.h | 2 +- > > include/sysemu/sysemu.h | 4 +++- > > migration.c | 9 ++++++++- > > savevm.c | 23 +++++++++++++++++++---- > > 5 files changed, 38 insertions(+), 7 deletions(-) > > > > diff --git a/arch_init.c b/arch_init.c > > index 6970733..44072d8 100644 > > --- a/arch_init.c > > +++ b/arch_init.c > > @@ -1192,6 +1192,12 @@ static int ram_load(QEMUFile *f, void *opaque, int version_id) > > return ret; > > } > > > > +/* RAM's always up for postcopying */ > > +static bool ram_can_postcopy(void *opaque) > > +{ > > + return true; > > +} > > + > > static SaveVMHandlers savevm_ram_handlers = { > > .save_live_setup = ram_save_setup, > > .save_live_iterate = ram_save_iterate, > > @@ -1199,6 +1205,7 @@ static SaveVMHandlers savevm_ram_handlers = { > > .save_live_pending = ram_save_pending, > > .load_state = ram_load, > > .cancel = ram_migration_cancel, > > + .can_postcopy = ram_can_postcopy, > > Is there actually any plausible device for which you'd need a callback > here, rather than just having a static bool? > > On the other hand, it does seem kind of plausible that there might be > situations in which some data from a device must be pre-copied, but > more can be post-copied, which would necessitate extending the > per-handler callback to return quantities for both. It's cheap enough and I couldn't make a strong argument about any possible device, so I just used the function. Dave > -- > David Gibson | I'll have my music baroque, and my code > david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ > | _way_ _around_! > http://www.ozlabs.org/~dgibson -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK