[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/3] qapi, audio: add query-audiodev command
From: |
Eric Blake |
Subject: |
Re: [PATCH 1/3] qapi, audio: add query-audiodev command |
Date: |
Tue, 2 Mar 2021 13:03:35 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 |
On 3/2/21 11:55 AM, Daniel P. Berrangé wrote:
> Way back in QEMU 4.0, the -audiodev command line option was introduced
> for configuring audio backends. This CLI option does not use QemuOpts
> so it is not visible for introspection in 'query-command-line-options',
> instead using the QAPI Audiodev type. Unfortunately there is also no
> QMP command that uses the Audiodev type, so it is not introspectable
> with 'query-qmp-schema' either.
>
> This introduces a 'query-audiodev' command that simply reflects back
> the list of configured -audiodev command line options. This in turn
> makes Audiodev introspectable via 'query-qmp-schema'.
Even if we never call the query-audiodev command, its mere existence is
useful ;)
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> audio/audio.c | 19 +++++++++++++++++++
> qapi/audio.json | 13 +++++++++++++
> 2 files changed, 32 insertions(+)
> +AudiodevList *qmp_query_audiodevs(Error **errp)
> +{
> + AudiodevList *ret = NULL, *prev = NULL, *curr;
> + AudiodevListEntry *e;
> + QSIMPLEQ_FOREACH(e, &audiodevs, next) {
> + curr = g_new0(AudiodevList, 1);
> + curr->value = QAPI_CLONE(Audiodev, e->dev);
> + if (prev) {
> + prev->next = curr;
> + prev = curr;
> + } else {
> + ret = prev = curr;
> + }
Please use QAPI_LIST_PREPEND here instead of open-coding it.
> +
> +##
> +# @query-audiodevs:
> +#
> +# Returns information about audiodev configuration
> +#
> +# Returns: array of @Audiodev
> +#
> +# Since: 6.0
> +#
> +##
> +{ 'command': 'query-audiodevs',
> + 'returns': ['Audiodev'] }
>
Otherwise looks nice.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
- Re: [PATCH 2/3] qapi, audio: respect build time conditions in audio schema, (continued)
Re: [PATCH 2/3] qapi, audio: respect build time conditions in audio schema, Markus Armbruster, 2021/03/05
[PATCH 3/3] qapi: provide a friendly string representation of QAPI classes, Daniel P . Berrangé, 2021/03/02
[PATCH 1/3] qapi, audio: add query-audiodev command, Daniel P . Berrangé, 2021/03/02
Re: [PATCH 1/3] qapi, audio: add query-audiodev command, Markus Armbruster, 2021/03/05