From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XriBJ-0007fN-0W for qemu-devel@nongnu.org; Fri, 21 Nov 2014 01:59:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XriBE-0008BS-7p for qemu-devel@nongnu.org; Fri, 21 Nov 2014 01:59:00 -0500 Received: from ozlabs.org ([103.22.144.67]:60410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XriBD-00088z-Tr for qemu-devel@nongnu.org; Fri, 21 Nov 2014 01:58:56 -0500 Date: Fri, 21 Nov 2014 17:58:06 +1100 From: David Gibson Message-ID: <20141121065806.GN2867@voom.redhat.com> References: <1412358473-31398-1-git-send-email-dgilbert@redhat.com> <1412358473-31398-25-git-send-email-dgilbert@redhat.com> <20141104013348.GE27321@voom.fritz.box> <20141119175353.GO2355@work-vm> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dZihrQ6eCIduWT38" Content-Disposition: inline In-Reply-To: <20141119175353.GO2355@work-vm> 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: "Dr. David Alan Gilbert" 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 --dZihrQ6eCIduWT38 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 19, 2014 at 05:53:54PM +0000, Dr. David Alan Gilbert wrote: > * 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" > > >=20 > > > Use that to split the qemu_savevm_state_pending counts into postcopia= ble > > > and non-postcopiable amounts > > >=20 > > > 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(-) > > >=20 > > > 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; > > > } > > > =20 > > > +/* RAM's always up for postcopying */ > > > +static bool ram_can_postcopy(void *opaque) > > > +{ > > > + return true; > > > +} > > > + > > > static SaveVMHandlers savevm_ram_handlers =3D { > > > .save_live_setup =3D ram_save_setup, > > > .save_live_iterate =3D ram_save_iterate, > > > @@ -1199,6 +1205,7 @@ static SaveVMHandlers savevm_ram_handlers =3D { > > > .save_live_pending =3D ram_save_pending, > > > .load_state =3D ram_load, > > > .cancel =3D ram_migration_cancel, > > > + .can_postcopy =3D ram_can_postcopy, > >=20 > > Is there actually any plausible device for which you'd need a callback > > here, rather than just having a static bool? > >=20 > > 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. >=20 > It's cheap enough and I couldn't make a strong argument about > any possible device, so I just used the function. Ok. I still wonder if it might be better to instead extend the save_live_pending callback in order to return both non-postcopyable and postcopyable quantites. It allows for the case of a postcopyable device which has some non-postcopyable data - and with any postcopyable device other than RAM, it seems likely that there will need to be some precopied metadata at least. Plus it avoids adding another callback. --=20 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 --dZihrQ6eCIduWT38 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUbuJ9AAoJEGw4ysog2bOSNJUQAIT7mPoA82ZO8M1hTMCoYnoF WqW2eNJ/kHu7tYJct3luSUPDBYfSK49KyYfk6sPHxcs4d5B2xX4MEEKrLCindE2J SjbvFokhXIcimAB1Zvquu24tFLDyCnsj3bEUZhKmsoKGY+naSAXyuDed4LQAQbb7 Kfw0w4vXzrBggV773Y+ikXJSM+eDR863Bng5h1Z8EcCHcGP8QjgkUcsw799UZEmg k0bWFXYsalxpeqSUBMxviFipXi8xuH1UlKowbyDm6rVsjBkpghi/AorGWbe0F3AP 9rGE+537YpJkOYExmHdLjnRN8f5pEEnbw9daKDThPU9gvHdskbollTnptqW9umHs 7380KeaPw0GQFOr9m/uWMUAp252MT/QWIA0gvdtQSjHAL+Tck2EfxocrEakl8N4k VuUR/A8I3R+o6vlmnZVRK/9rW3s80MYyPY9g3pxB2MpqIRuSvDV7u98H10UyWRSF oPkFefZ6FmY8DLOu3h0wFv9+JmzYEfKkkHpnUIcvkSpRpdFEyTqNJPpXOkvPjylW 6wxODhLFdqCraDoBcggyvAwSAV5Su/toIq6gicDj+989olQ2Lox9MKVdcVyboMct 9MZ0dZBhlEAQX7fu+RfmQ2AoGfFSsbY1BDXgOsVXgFin/YbbwIrkC+tfPt/suJg+ 7+7IwulbCqeYssGxrX7W =beis -----END PGP SIGNATURE----- --dZihrQ6eCIduWT38--