qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 06/52] audio: -audiodev command line option b


From: Zoltán Kővágó
Subject: Re: [Qemu-devel] [PATCH v2 06/52] audio: -audiodev command line option basic implementation
Date: Thu, 10 Jan 2019 10:40:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 2019-01-10 08:25, Gerd Hoffmann wrote:
>   Hi,
> 
>> I was thinking about creating an Audiodev (the qapi type) directly would
>> be better, then somehow print it with reflection.  While this is not a
>> typical use of qapi, at least qmp_qom_list creates qapi objects
>> directly, so I assume it's ok.
> 
> Yes, it's perfectly fine.
> 
>> The second problem: with my patched options visitor, nested structs were
>> required in qapi, the options visitor unconditionally filled them.  With
>> qobject_input_visitor, I have to mark them optional, otherwise the user
>> have to specify at least one option from the nested structs.
> 
> Can we just drop the nesting?
> 
> Have a look at DisplayOptions (qapi struct used to store -display
> options).  It's a union, has some common base fields, and the
> discriminator field (type in that case) decides which of the data
> branches is used.  And on the command line I can do stuff like this:
> 
>   -display gtk,full-screen=on,zoom-to-fit=on
>                               ^^^^^^^^^^^     in struct DisplayGTK
>                ^^^^^^^^^^^                    common base field
> 
> Audiodev should be able to do the same to support backend-specific
> options without nesting.

I think that union thing works, the problem is with input and output
settings, because they're common.  Currently you can write in.frequency
and out.frequency, in and out are both AudiodevPerDirectionOptions.  The
alternative would be to flatten the whole structure and have
in_frequency, out_frequency and everything else duplicated in Audiodev

Regards,
Zoltan



reply via email to

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