qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC PATCH 3/4] qmp: Introduce memchar_write QMP comman


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC PATCH 3/4] qmp: Introduce memchar_write QMP command
Date: Wed, 01 Aug 2012 09:50:11 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0

On 08/01/2012 03:48 AM, Lei Li wrote:
> Signed-off-by: Lei Li <address@hidden>
> ---
>  qapi-schema.json |   20 ++++++++++++++++++++
>  qemu-char.c      |   19 +++++++++++++++++++
>  qmp-commands.hx  |   29 +++++++++++++++++++++++++++++
>  3 files changed, 68 insertions(+), 0 deletions(-)
> 
> 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'] }
>  
>  ##
> +# @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 
> currently, it will
>  EQMP
>  
>      {
> +        .name       = "memchar_write",

s/_/-/

> +        .args_type  = "chardev:s,size:i,data:s",
> +        .mhandler.cmd_new = 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?

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]