qemu-devel
[Top][All Lists]
Advanced

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

Re: Let's remove some deprecated stuff


From: Paolo Bonzini
Subject: Re: Let's remove some deprecated stuff
Date: Mon, 3 May 2021 17:10:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1

On 29/04/21 14:40, Gerd Hoffmann wrote:
In other words you would do something like -audiohw
<audiodev-args>,model=xxx and it gets desugared automatically to either

    -audiodev <audiodev-args>,id=foo -device devname,audiodev=xxx

or

    -audiodev <audiodev-args>,id=foo -M propname=foo
Suggestions how to do that in a clean way?
Given that -audiodev is qapi-based I tried it this way:

Since this is sugar, I think it's okay to make it desugar into QAPI, instead of being QAPI all the way down:

- use qobject_input_visitor_new_str in softmmu/vl.c

- visit the "model" key

- look up the "model", fail if it doesn't match a known model

- pass the rest into a variant of audio_parse_option that takes a Visitor and returns and Audiodev*

- pass the id into a constructor function keyed by the model

Paolo




reply via email to

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