From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVHzO-0002cw-Rc for qemu-devel@nongnu.org; Tue, 10 Mar 2015 07:06:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVHzL-00055H-Dn for qemu-devel@nongnu.org; Tue, 10 Mar 2015 07:06:18 -0400 Received: from ozlabs.org ([103.22.144.67]:35022) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVHzL-000530-2o for qemu-devel@nongnu.org; Tue, 10 Mar 2015 07:06:15 -0400 Date: Tue, 10 Mar 2015 22:06:52 +1100 From: David Gibson Message-ID: <20150310110652.GK11973@voom.redhat.com> References: <1424883128-9841-1-git-send-email-dgilbert@redhat.com> <1424883128-9841-10-git-send-email-dgilbert@redhat.com> <20150310045815.GA11973@voom.redhat.com> <20150310110414.GE2338@work-vm> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eWmFpGZayiNrn4FL" Content-Disposition: inline In-Reply-To: <20150310110414.GE2338@work-vm> Subject: Re: [Qemu-devel] [PATCH v5 09/45] Migration commands 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 --eWmFpGZayiNrn4FL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 10, 2015 at 11:04:14AM +0000, Dr. David Alan Gilbert wrote: > * David Gibson (david@gibson.dropbear.id.au) wrote: > > On Wed, Feb 25, 2015 at 04:51:32PM +0000, Dr. David Alan Gilbert (git) = wrote: > > > From: "Dr. David Alan Gilbert" > > >=20 > > > Create QEMU_VM_COMMAND section type for sending commands from > > > source to destination. These commands are not intended to convey > > > guest state but to control the migration process. > > >=20 > > > For use in postcopy. > > >=20 > > > Signed-off-by: Dr. David Alan Gilbert > >=20 > > [snip] > > > +/* Send a 'QEMU_VM_COMMAND' type element with the command > > > + * and associated data. > > > + */ > > > +void qemu_savevm_command_send(QEMUFile *f, > > > + enum qemu_vm_cmd command, > > > + uint16_t len, > > > + uint8_t *data) > > > +{ > > > + uint32_t tmp =3D (uint16_t)command; > >=20 > > Erm.. cast to u16, assign to u32, then send as u16? What's up with > > that? >=20 > Hmm yes, that is insane; now changed to: >=20 > +void qemu_savevm_command_send(QEMUFile *f, > + enum qemu_vm_cmd command, > + uint16_t len, > + uint8_t *data) > +{ > + qemu_put_byte(f, QEMU_VM_COMMAND); > + qemu_put_be16(f, (uint16_t)command); > + qemu_put_be16(f, len); > + if (len) { > + qemu_put_buffer(f, data, len); > + } > + qemu_fflush(f); > +} That looks better. --=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 --eWmFpGZayiNrn4FL Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJU/tBMAAoJEGw4ysog2bOSiDsQAN/Swex+d51Vcse2y31qWY2h P80m4kxXONmjqnHFQCtwXQa4P8NG8+nqQ1oaJPGEBx2bDf8Uu6TK0v0MFTU49rwV uAk6RdFxEsEFXAihg/FRduuov05cfmc4JuKe1srM9rYXn1AstJ6b7vQ+ySuJjxRO /70YtQftgBp0Lgfph4f3HYn/tQzyX3XsUco4p1rl23xcE3vUteTSksiqxnI4MWFN blsbC8lC8rtm65VoRgVpXBT5CIBYklOa5SnkDHW4rh2KsDvFl87nFXp+UWnIWNXi g5LTJF78wMYrUZe7DyiC8rK2XqBnWRgd6R9W+eIDZkKxA1B+YPZ1EGlXsjeHRP5K VclSexN7ybMw6fxgTyFiqqnlb9W6/jevKfk3NUg34PKV4FGcTOKwa9VJaj5klhHF BQ51VGsEvzvCqt41G9TSk+LHJ02Y6qT021F5ns3vkTpDb0mGyyrT9XhSLv6Y/wi5 /gWvmKkUFgthSq+AuFtIxaxr5CJ0oY2MXfVQhj+32lWHvaT3b4/7uaZHJKiQyIH/ rlycgmADwaa6q7fi9Etd5jvGTRmUsQme4mXo6lsz80vVXUAWU1pjFGKPCAglOZm6 3FjeR+EnOTkBC0aWlrOvapH1XofpkakRCQye3HLvDnGLd34BgyE1DbrV5Wxi18MO lxNe5yfBi6VkkznKIdWu =9bjK -----END PGP SIGNATURE----- --eWmFpGZayiNrn4FL--