From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF6OI-0002UF-0K for qemu-devel@nongnu.org; Wed, 06 Aug 2014 14:56:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF6OD-0000YH-2G for qemu-devel@nongnu.org; Wed, 06 Aug 2014 14:56:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF6OC-0000YD-QE for qemu-devel@nongnu.org; Wed, 06 Aug 2014 14:56:44 -0400 Message-ID: <53E27A65.2070500@redhat.com> Date: Wed, 06 Aug 2014 12:56:37 -0600 From: Eric Blake MIME-Version: 1.0 References: <1407346234-8156-1-git-send-email-dgilbert@redhat.com> <1407346234-8156-2-git-send-email-dgilbert@redhat.com> In-Reply-To: <1407346234-8156-2-git-send-email-dgilbert@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fnmNcppNpuu8gH4JaVLf1rTgkcLXnaFSJ" Subject: Re: [Qemu-devel] [PATCH 1/2] QEMUSizedBuffer based QEMUFile List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" , qemu-devel@nongnu.org Cc: joel.schopp@amd.com, stefanb@linux.vnet.ibm.com, quintela@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fnmNcppNpuu8gH4JaVLf1rTgkcLXnaFSJ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/06/2014 11:30 AM, Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" >=20 > This is based on Stefan and Joel's patch that creates a QEMUFile that g= oes > to a memory buffer; from: >=20 > http://lists.gnu.org/archive/html/qemu-devel/2013-03/msg05036.html >=20 > Using the QEMUFile interface, this patch adds support functions for > operating on in-memory sized buffers that can be written to or read fro= m. >=20 > Signed-off-by: Stefan Berger > Signed-off-by: Joel Schopp >=20 > For minor tweeks/rebase I've done to it: > Signed-off-by: Dr. David Alan Gilbert > --- > include/migration/qemu-file.h | 28 +++ > include/qemu/typedefs.h | 1 + > qemu-file.c | 410 ++++++++++++++++++++++++++++++++++= ++++++++ > 3 files changed, 439 insertions(+) > +/** > + * Set the length of the buffer; the primary usage of this > + * function is to truncate the number of used bytes in the buffer. > + * The size will not be extended beyond the current number of > + * allocated bytes in the QEMUSizedBuffer. > + * > + * @qsb: A QEMUSizedBuffer > + * @new_len : The new length of bytes in the buffer No space before : > +/* > + * Convert the QEMUSizedBuffer into a flat buffer. > + * > + * Note: If at all possible, try to avoid this function since it > + * may unnecessarily copy memory around. > + * > + * @qsb: pointer to QEMUSizedBuffer > + * @start : offset to start at and again > + * @count: number of bytes to copy > + * @buf: a pointer to an optional buffer to write into; the pointer ma= y > + * point to NULL in which case the buffer will be allocated; > + * if buffer is provided, it must be large enough to hold @count= bytes > + * > + * Returns the number of bytes copied into the output buffer spurious double space --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --fnmNcppNpuu8gH4JaVLf1rTgkcLXnaFSJ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJT4nplAAoJEKeha0olJ0Nqn3oH/30touCWW+jvmQAlN6h97NDv ZW59eBKU6lCNxIsQ103NRn7I/be8dFp3JA14of4KqqK43s508eWofJCO0sMCNK0M 1O+tlUabx8LTrPT4XR4MRTYbcqsSOuYl+2/AcYL1+sBxeoCT1L+FJlta/oziGhHP 90n3zMHirvcUVy52Bq5J6DFM9EAOBHa8no10yCRhuikWX7gHPxf0BT707ErqFUYy J4upkw3fv9Lx+pnXtq8m7lkaR4MlnYThml1P9/Sm/3XyC6SX6Vo1hkSRYL0/C9I7 rR/r4q6ztb1l+CgutDHOXNTTx1QxlcuWxMEjBxJG+ML74FHsikRI/fpmJh5DU6Y= =bvp5 -----END PGP SIGNATURE----- --fnmNcppNpuu8gH4JaVLf1rTgkcLXnaFSJ--