From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQIgl-0007Xl-1a for qemu-devel@nongnu.org; Mon, 22 Oct 2012 10:09:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQIgb-0008SH-GX for qemu-devel@nongnu.org; Mon, 22 Oct 2012 10:09:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33532) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQIgb-0008S3-7N for qemu-devel@nongnu.org; Mon, 22 Oct 2012 10:08:57 -0400 Message-ID: <5085536D.3010502@redhat.com> Date: Mon, 22 Oct 2012 08:08:45 -0600 From: Eric Blake MIME-Version: 1.0 References: <1350838081-6351-1-git-send-email-lilei@linux.vnet.ibm.com> <1350838081-6351-2-git-send-email-lilei@linux.vnet.ibm.com> In-Reply-To: <1350838081-6351-2-git-send-email-lilei@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig9858D735E50C5831C84267F8" Subject: Re: [Qemu-devel] [PATCH 1/5] qemu-char: Add new char backend CircularMemCharDriver List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lei Li Cc: blauwirbel@gmail.com, aliguori@us.ibm.com, qemu-devel@nongnu.org, lcapitulino@redhat.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig9858D735E50C5831C84267F8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 10/21/2012 10:47 AM, Lei Li wrote: > Signed-off-by: Lei Li > --- > qemu-char.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++ > 1 files changed, 72 insertions(+), 0 deletions(-) >=20 > diff --git a/qemu-char.c b/qemu-char.c > index b082bae..b174da1 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -2588,6 +2588,78 @@ size_t qemu_chr_mem_osize(const CharDriverState = *chr) > return d->outbuf_size; > } > =20 > +/*********************************************************/ > +/*CircularMemoryr chardev*/ s/CircularMemoryr/CircularMemory/ > +static int cirmem_chr_write(CharDriverState *chr, const uint8_t *buf, = int len) > +{ > + CirMemCharDriver *d =3D chr->opaque; > + int i; > + > + if (len < 0) { > + return -1; > + } > + > + /* The size should be a power of 2. */ Shouldn't you enforce that, then? --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig9858D735E50C5831C84267F8 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.4.12 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iQEcBAEBCAAGBQJQhVNtAAoJEKeha0olJ0NqiZQH/RnlMeQSQvqVb8OfE5LHJhcW UQZAmnnNbuFqWBeM0lhpJC3wv8enSlyT+JcU7zrZ8aF9b4OfyQETQd7pIIlK+GiL +fGR9QsSxo6eLMkGig9g15MBuZPnUlevEX4rktw0psPBPCsueFG3bxwKoB5G0jVu MOY8KhwiXrF7+NMTvhcNC++HUdkcQ+e1w6Qf++PEg8W6a+he4WlxHA/EoE/W9Txg V+cJAuGj0KgYELPAddFDF7gPT5ntVDcHHWm0WHKsj1vBdT2yh5f1cjXBuyKneyTZ oOMk6ki7s+O2VD5WI/NZPATTctHEEC90Aik4eAf6MbePAiSzYUP394txZsmZPl0= =QcEU -----END PGP SIGNATURE----- --------------enig9858D735E50C5831C84267F8--