From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwbBm-00041L-0R for qemu-devel@nongnu.org; Wed, 01 Aug 2012 11:50:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwbBh-0004fh-KU for qemu-devel@nongnu.org; Wed, 01 Aug 2012 11:50:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31580) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwbBh-0004fV-C8 for qemu-devel@nongnu.org; Wed, 01 Aug 2012 11:50:17 -0400 Message-ID: <50195033.7020504@redhat.com> Date: Wed, 01 Aug 2012 09:50:11 -0600 From: Eric Blake MIME-Version: 1.0 References: <1343814538-27591-1-git-send-email-lilei@linux.vnet.ibm.com> <1343814538-27591-4-git-send-email-lilei@linux.vnet.ibm.com> In-Reply-To: <1343814538-27591-4-git-send-email-lilei@linux.vnet.ibm.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig577483FC1F2DE986AFC2027A" Subject: Re: [Qemu-devel] [RFC PATCH 3/4] qmp: Introduce memchar_write QMP command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lei Li Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, stefanha@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig577483FC1F2DE986AFC2027A Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/01/2012 03:48 AM, Lei Li wrote: > Signed-off-by: Lei Li > --- > qapi-schema.json | 20 ++++++++++++++++++++ > qemu-char.c | 19 +++++++++++++++++++ > qmp-commands.hx | 29 +++++++++++++++++++++++++++++ > 3 files changed, 68 insertions(+), 0 deletions(-) >=20 > diff --git a/qapi-schema.json b/qapi-schema.json > index bc55ed2..3c8530f 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -206,6 +206,26 @@ > { 'command': 'query-chardev', 'returns': ['ChardevInfo'] } > =20 > ## > +# @memchar_write: s/memchar_write/memchar-write/ New QMP commands should use '-' not '_'. > +# > +# Provide writing interface for memchardev. Write data to memchar > +# char device. > +# > +# @chardev: the name of the memchar char device. > +# > +# @size: the size to write in bytes. > +# > +# @data: the source data write to memchar. Does this allow full binary data processing, or does the data need something like base64 encoding? > +# > +# Returns: Nothing on success > +# If an I/O error occurs while writing, IOError > +# > +# Since: 1.2 > +## > +{ 'command': 'memchar_write', s/_/-/ > +++ b/qmp-commands.hx > @@ -441,6 +441,35 @@ Note: inject-nmi is only supported for x86 guest c= urrently, it will > EQMP > =20 > { > + .name =3D "memchar_write", s/_/-/ > + .args_type =3D "chardev:s,size:i,data:s", > + .mhandler.cmd_new =3D qmp_marshal_input_memchar_write, > + }, > + > +SQMP > +memchar_write > +------------- > + > +Provide writing interface for memchardev. Write data to memchar > +char device. > + > +Arguments: > + > +- "chardev": the name of the char device, must be unique (json-string)= > +- "size": the memory size, in bytes (json-int) > +- "data": the source data writed to memchar (json-string) s/writed/written/ > + > +Example: > + > +-> { "execute": "memchar_write", > + "arguments": { "chardev": foo, > + "size": 1000, > + "data": "data string" } } 1000 is longer than strlen("data string"). Is there supposed to be a correlation? Is there a start offset to worry about, or do memchardevs always behave like they are in append mode? --=20 Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --------------enig577483FC1F2DE986AFC2027A 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://enigmail.mozdev.org/ iQEcBAEBCAAGBQJQGVA0AAoJEKeha0olJ0NqUcgIAJTLYTMh0l25jvOB8OOqGamV QjXaKxg1GK8uolZ1o9arClJouUdarkbIePRfrwLvPXMbGiqacWMl1l+FVpuwtPy2 Z483j8RgyPfxMVpMtTOYhbDtgRXGHY7HkHTVxDANredfsIx1G/vB1emxPouLVt/C 1rOXOg4UrnwcEEtx7Ty2sY78CfQjyrBL1UspYQhUtEIV1F4xLOytmRhS2+zmI8j2 tBVXVTudtYode4O1t8LwWZik9H8dc5DV1T1/hOI93w3AClH6l+5ALJBYDQma52v+ 0mFP01Uq5C3PvTQJc4460e+8IzzFcPOZi+UlS97VKJQ8G8pRUSbS02AQhYHzLnA= =Smnn -----END PGP SIGNATURE----- --------------enig577483FC1F2DE986AFC2027A--