From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXOgY-0008DO-GC for qemu-devel@nongnu.org; Mon, 16 Mar 2015 02:39:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YXOgV-0005Lp-9v for qemu-devel@nongnu.org; Mon, 16 Mar 2015 02:39:34 -0400 Received: from ozlabs.org ([103.22.144.67]:33144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YXOgU-0005LT-UL for qemu-devel@nongnu.org; Mon, 16 Mar 2015 02:39:31 -0400 Date: Mon, 16 Mar 2015 17:16:45 +1100 From: David Gibson Message-ID: <20150316061645.GD5741@voom.redhat.com> References: <1424883128-9841-1-git-send-email-dgilbert@redhat.com> <1424883128-9841-19-git-send-email-dgilbert@redhat.com> <20150313005558.GY11973@voom.redhat.com> <20150313115141.GD2486@work-vm> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yEPQxsgoJgBvi8ip" Content-Disposition: inline In-Reply-To: <20150313115141.GD2486@work-vm> Subject: Re: [Qemu-devel] [PATCH v5 18/45] MIG_CMD_PACKAGED: Send a packaged chunk of migration stream 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, qemu-devel@nongnu.org, amit.shah@redhat.com, pbonzini@redhat.com, yanghy@cn.fujitsu.com --yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Mar 13, 2015 at 11:51:42AM +0000, Dr. David Alan Gilbert wrote: > * David Gibson (david@gibson.dropbear.id.au) wrote: > > On Wed, Feb 25, 2015 at 04:51:41PM +0000, Dr. David Alan Gilbert (git) = wrote: > > > From: "Dr. David Alan Gilbert" > > >=20 > > > MIG_CMD_PACKAGED is a migration command that allows a chunk > > > of migration stream to be sent in one go, and be received by > > > a separate instance of the loadvm loop while not interacting > > > with the migration stream. > >=20 > > Hrm. I'd be more comfortable if the semantics of CMD_PACKAGED were > > defined in terms of visible effects on the other end, rather than in > > terms of how it's implemented internally. > >=20 > > > This is used by postcopy to load device state (from the package) > > > while loading memory pages from the main stream. > >=20 > > Which makes the above paragraph a bit misleading - the whole point > > here is that loading the package data *does* interact with the > > migration stream - just that it's the migration stream after the end > > of the package. >=20 > Hmm, how about: >=20 >=20 > MIG_CMD_PACKAGED is a migration command that wraps a chunk of migration > stream inside a package whose length can be determined purely by reading > its header. The destination guarantees that the whole MIG_CMD_PACKAGED is > read off the stream prior to parsing the contents. >=20 > This is used by postcopy to load device state (from the package) > while leaving the main stream free to receive memory pages. It's an improvement. I'm still a bit concerned that the semantics of CMD_PACKAGED are unhealthily bound up with hw the current implementation works. [snip] > > > +/* Immediately following this command is a blob of data containing a= n embedded > > > + * chunk of migration stream; read it and load it. > > > + */ > > > +static int loadvm_handle_cmd_packaged(MigrationIncomingState *mis, > > > + uint32_t length) > > > +{ > > > + int ret; > > > + uint8_t *buffer; > > > + QEMUSizedBuffer *qsb; > > > + > > > + trace_loadvm_handle_cmd_packaged(length); > > > + > > > + if (length > MAX_VM_CMD_PACKAGED_SIZE) { > > > + error_report("Unreasonably large packaged state: %u", length= ); > > > + return -1; > >=20 > > It would be a good idea to check this on the send side as well as > > receive, wouldn't it? >=20 > Yes, I had been doing that in the postcopy code that called the > send code; but I've now moved it down into savevm_send_packaged. Good, better symmetry that way. --=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 --yEPQxsgoJgBvi8ip Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJVBnVNAAoJEGw4ysog2bOSI1gQANMikF60YjRIXHtO7CPDt9/T Ms7UEOK8RpAep5iDKXidkxA+gOsEYVzOr9ePBgN81RiqKNLttUhY/oo2H7aBq4Hj kuD9GrDX+rVPeSIX+bIN6AobXgBXZ1vXI3D/fW4WprQUpKV9f8wF4fJVJ4VePDpr MwzrYqotUh6lv2JNX8qoalN6IBNqNI/9iC+du2BdXikf/mfbYgDCMaeTNablKj+0 xvNBaAyeaAZvjdD2aUVBRC3o17fv5v4KQMdkuUqIqo4GLzVBvm4RjrLawzBcNJRA audYu4DZy/sYh0Qnz72FTc1Dd3qw9oPxZ35GfmWd7BTCwsvM0vcH7AkYrabYKPXQ XF0eO7FEM3qZBDQ6k5XzopvkNVweRo/QYBUkq942jv016f7QBn7vJinHymaFh3AV Pp/t0LRk/Q5Cd64PyU5b7pB6H2Q3fV8XSm1asK8vVGYsvZL6fRSiLX5MDGaxFtjv xkgnBARImIdR4WSq0T2Dib9usHD9ch2xHxAoqF4FDer1hyGcNzSX9iV6o2N1Fd6G YKT4JiEQCwFTVU5eetCQHrOt7/NMYUjfaozuovpPcWaVidVLZn27slhv0vTTSa96 BYsGthYoXPKxv8pofYMPGaABImhDkdDHec/YtzN/FaJ+OWIMkPQZDPCpv994qvsN e2P17qBPbgeTtT518j42 =3g+U -----END PGP SIGNATURE----- --yEPQxsgoJgBvi8ip--