From: Eric Blake <eblake@redhat.com>
To: Lei Li <lilei@linux.vnet.ibm.com>
Cc: aliguori@us.ibm.com, lcapitulino@redhat.com,
qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH 4/5] QAPI: Introduce memchar-read QMP command
Date: Wed, 12 Sep 2012 09:01:45 -0600 [thread overview]
Message-ID: <5050A3D9.8030805@redhat.com> (raw)
In-Reply-To: <1347451046-5513-5-git-send-email-lilei@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 2490 bytes --]
On 09/12/2012 05:57 AM, Lei Li wrote:
> Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
> ---
> hmp-commands.hx | 25 +++++++++++++++++++++++++
> hmp.c | 18 ++++++++++++++++++
> hmp.h | 1 +
> qapi-schema.json | 27 +++++++++++++++++++++++++++
> qemu-char.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
> qmp-commands.hx | 37 +++++++++++++++++++++++++++++++++++++
> 6 files changed, 156 insertions(+), 0 deletions(-)
>
> +++ b/qapi-schema.json
> @@ -305,6 +305,33 @@
> '*control': 'CongestionControl'} }
>
> ##
> +# @memchar-read:
> +#
> +# Provide read interface for CirMemCharDriver. Read from cirmemchar
> +# char device and return the data.
> +#
> +# @chardev: the name of the cirmemchar char device.
> +#
> +# @size: the size to read in bytes.
> +#
> +# @format: #optional the format of the data want to read from
> +# CirMemCharDriver, by default is 'utf8'.
> +#
> +# @control: #optional options for read and write command that specifies
> +# behavior when the queue is full/empty.
> +#
> +# Returns: The data read from cirmemchar as string.
> +# If @chardev is not a valid memchr device, DeviceNotFound
> +# If an I/O error occurs while reading, IOError
> +#
> +# Since: 1.3
> +##
> +{ 'command': 'memchar-read',
> + 'data': {'chardev': 'str', 'size': 'int', '*format': 'DataFormat',
> + '*control': 'CongestionControl'},
> + 'returns': 'str' }
What happens if the data to be read contains embedded NUL, but the
requested 'format' can't express that? What happens if there is less
data available than the maximum requested size? I'm wondering if the
return should be a JSON struct, { 'data':'str', 'size':'int' }, in order
to allow for the case of short read returns.
> +- "chardev": the name of the char device, must be unique (json-string)
> +- "size": the memory size in bytes, init size of the cirmemchar
> + by default (json-int)
> +- "format": the data format write to CirMemCharDriver, default is
> + utf8. (json-string, optional)
> + - Possible values: "utf8", "base64"
Also, you probably want to make it crystal-clear whether size is
referring to the unencoded size of the raw data, or the encoded size
after conversion to utf8 or base64.
--
Eric Blake eblake@redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 617 bytes --]
next prev parent reply other threads:[~2012-09-12 15:02 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-12 11:57 [Qemu-devel] [RFC v3 ATCH 0/5] char: expose CirMemCharDriver and provide QMP interface Lei Li
2012-09-12 11:57 ` [Qemu-devel] [PATCH 1/5] qemu-char: Add new char device CirMemCharDriver Lei Li
2012-09-19 17:43 ` Luiz Capitulino
2012-09-12 11:57 ` [Qemu-devel] [PATCH 2/5] Expose CirMemCharDriver via command line Lei Li
2012-09-19 17:45 ` Luiz Capitulino
2012-09-12 11:57 ` [Qemu-devel] [PATCH 3/5] QAPI: Introduce memchar-write QMP command Lei Li
2012-09-14 17:18 ` Blue Swirl
2012-09-19 18:05 ` Luiz Capitulino
2012-09-20 7:42 ` Lei Li
2012-09-20 20:05 ` Luiz Capitulino
2012-09-12 11:57 ` [Qemu-devel] [PATCH 4/5] QAPI: Introduce memchar-read " Lei Li
2012-09-12 15:01 ` Eric Blake [this message]
2012-09-14 17:29 ` Blue Swirl
2012-09-12 11:57 ` [Qemu-devel] [PATCH 5/5] HMP: Introduce console command Lei Li
2012-09-14 17:15 ` Blue Swirl
2012-09-19 18:11 ` Luiz Capitulino
2012-09-12 15:53 ` [Qemu-devel] [RFC v3 ATCH 0/5] char: expose CirMemCharDriver and provide QMP interface Avi Kivity
2012-09-12 16:12 ` Daniel P. Berrange
2012-09-13 1:58 ` Anthony Liguori
2012-09-19 17:40 ` Luiz Capitulino
-- strict thread matches above, loose matches on Subject: below --
2012-10-21 16:47 [Qemu-devel] [PATCH 0/5 V4] char: add " Lei Li
2012-10-21 16:48 ` [Qemu-devel] [PATCH 4/5] QAPI: Introduce memchar-read QMP command Lei Li
2012-10-22 18:43 ` Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5050A3D9.8030805@redhat.com \
--to=eblake@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=armbru@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=lilei@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).