On 08/01/2012 03:48 AM, Lei Li wrote: > Signed-off-by: Lei Li <li...@linux.vnet.ibm.com> > --- > 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 ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature