[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qmp: expose list of supported character device
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] qmp: expose list of supported character device backends |
Date: |
Fri, 31 Jan 2014 06:27:10 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
On 01/31/2014 03:35 AM, Martin Kletzander wrote:
> Introduce 'query-chardev-backends' QMP command which lists all
> supported character device backends.
>
> Signed-off-by: Martin Kletzander <address@hidden>
> ---
> qapi-schema.json | 22 ++++++++++++++++++++++
> qemu-char.c | 19 +++++++++++++++++++
> qmp-commands.hx | 41 +++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 82 insertions(+)
>
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 05ced9d..ac1061f 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -437,6 +437,28 @@
> { 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
>
> ##
> +# @ChardevBackendInfo:
> +#
> +# Information about a character device backend
> +#
> +# @name: The backend name
> +#
> +# Since: 1.8.0
2.0 will be the next release.
> +##
> +{ 'type': 'ChardevBackendInfo', 'data': {'name': 'str'} }
> +
> +##
> +# @query-chardev-backends:
> +#
> +# Returns information about character device backends.
> +#
> +# Returns: a list of @ChardevBackendInfo
> +#
> +# Since: 1.8.0
Again, 2.0.
> +
> +-> { "execute": "query-chardev-backends" }
> +<- {
> + "return":[
> + {
> + "name":"udp",
> + },
This is somewhat complex, but allows us the option of future addition of
other items to return in addition to the name, if it proves useful
(returning a straight array of strings instead of an array of structs
prevents such future expansion). So I think you made the right choice.
With the fixes to the version number:
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature