qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3 9/9] chardev: add hotplug support.
Date: Mon, 15 Oct 2012 12:04:52 -0600	[thread overview]
Message-ID: <507C5044.5020403@redhat.com> (raw)
In-Reply-To: <1350288417-24350-10-git-send-email-kraxel@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2976 bytes --]

On 10/15/2012 02:06 AM, Gerd Hoffmann wrote:
> This patch adds chardev_add and chardev_del monitor commands.
> 
> They work simliar to the netdev_{add,del} commands.  The hmp version of

s/simliar/similar/

> chardev_add accepts like the -chardev command line option does.  The qmp
> version expects the arguments being passed as named parameters.
> 
> chardev_del just takes an id argument and zaps the chardev specified.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> +++ b/qapi-schema.json
> @@ -2796,3 +2796,42 @@
>  # Since: 0.14.0
>  ##
>  { 'command': 'screendump', 'data': {'filename': 'str'} }
> +
> +##
> +# @chardev_add:

chardev-add

> +#
> +# Add a chardev
> +#
> +# @id: the chardev's ID, must be unique
> +# @backend: the chardev backend: "file", "socket", ...

Should this be an enum type, instead of an open-coded string?

> +# @path: file / device / unix socket path
> +# @name: spice channel name
> +# @host: host name
> +# @port: port number
> +# @server: create socket in server mode
> +# @wait: wait for connect
> +# @ipv4: force ipv4-only
> +# @ipv6: force ipv6-only
> +# @telnet: telnet negotiation
> +#
> +# Returns: Nothing on success
> +#
> +# Since: 1.3.0
> +##
> +{ 'command': 'chardev_add', 'data': {'id'      : 'str',
> +                                     'backend' : 'str',
> +                                     '*props'  : '**' },

Having an open-coded list for props feels awkward; it would be nicer to
have the schema completely describe everything, even though that may be
more documentation work.

> +  'gen': 'no' }
> +
> +##
> +# @chardev_del:

chardev-del


> +Arguments:
> +
> +- "id": the chardev's ID, must be unique (json-string)
> +- "backend": the chardev backend: "file", "socket", ... (json-string)
> +- "path": file / device / unix socket path (json-string, optional)
> +- "name": spice channel name (json-string, optional)
> +- "host": host name (json-string, optional)
> +- "port": port number (json-string, optional)
> +- "server": create socket in server mode (json-bool, optional)

Given this line...

> +- "wait": wait for connect (json-bool, optional)
> +- "ipv4": force ipv4-only (json-bool, optional)
> +- "ipv6": force ipv6-only (json-bool, optional)
> +- "telnet": telnet negotiation (json-bool, optional)
> +
> +Example:
> +
> +-> { "execute": "chardev_add", "arguments": { "id"      : "foo",
> +                                              "backend" : "socket",
> +                                              "path"    : "/tmp/foo",
> +                                              "server"  : "on",

...this line is wrong, since "on" is not a json-bool.  It would have to
be "server":true

> +                                              "wait"    : "off" } }

Similar for "wait":false

-- 
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 --]

  parent reply	other threads:[~2012-10-15 18:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15  8:06 [Qemu-devel] [PATCH v3 0/9] serial device hotplug patch series Gerd Hoffmann
2012-10-15  8:06 ` [Qemu-devel] [PATCH v3 1/9] serial: split serial.c Gerd Hoffmann
2012-10-15 14:16   ` Anthony Liguori
2012-10-15  8:06 ` [Qemu-devel] [PATCH v3 2/9] serial: add pci variant Gerd Hoffmann
2012-10-15  8:06 ` [Qemu-devel] [PATCH v3 3/9] serial: add windows inf file for the pci card to docs Gerd Hoffmann
2012-10-15  8:06 ` [Qemu-devel] [PATCH v3 4/9] serial: add 2x + 4x pci variant Gerd Hoffmann
2012-10-15 14:18   ` Anthony Liguori
2012-10-15  8:06 ` [Qemu-devel] [PATCH v3 5/9] usb-serial: don't magically zap chardev on umplug Gerd Hoffmann
2012-10-15  8:06 ` [Qemu-devel] [PATCH v3 6/9] usb-serial: only expose device in guest when the chardev is open Gerd Hoffmann
2012-10-15  8:06 ` [Qemu-devel] [PATCH v3 7/9] chardev: add error reporting for qemu_chr_new_from_opts Gerd Hoffmann
2012-10-17  1:12   ` Luiz Capitulino
2012-10-17  1:13     ` Luiz Capitulino
2012-10-15  8:06 ` [Qemu-devel] [PATCH v3 8/9] chardev: fix QemuOpts lifecycle Gerd Hoffmann
2012-10-17  1:18   ` Luiz Capitulino
2012-10-15  8:06 ` [Qemu-devel] [PATCH v3 9/9] chardev: add hotplug support Gerd Hoffmann
2012-10-15 14:22   ` Anthony Liguori
2012-10-15 18:04   ` Eric Blake [this message]
2012-10-17  1:49     ` Luiz Capitulino
2012-10-16  9:13   ` Lei Li
2012-10-17  9:27     ` Gerd Hoffmann
2012-10-17  1:28   ` Luiz Capitulino
2012-10-17  1:52 ` [Qemu-devel] [PATCH v3 0/9] serial device hotplug patch series 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=507C5044.5020403@redhat.com \
    --to=eblake@redhat.com \
    --cc=kraxel@redhat.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).