On 2019-01-17 11:03, Gerd Hoffmann wrote:
> On Thu, Jan 17, 2019 at 12:37:20AM +0100, Kővágó, Zoltán wrote:
>> Add an option to change the channel map used by pulseaudio.  If not
>> specified, falls back to an OSS compatible channel map.
>>
>> Signed-off-by: Kővágó, Zoltán <dirty.ice...@gmail.com>
>> ---
>>  qapi/audio.json |  5 ++++-
>>  audio/paaudio.c | 18 ++++++++++++++----
>>  qemu-options.hx |  9 +++++++++
>>  3 files changed, 27 insertions(+), 5 deletions(-)
>>
>> diff --git a/qapi/audio.json b/qapi/audio.json
>> index 7bcea6240f..86078039dc 100644
>> --- a/qapi/audio.json
>> +++ b/qapi/audio.json
>> @@ -107,11 +107,14 @@
>>  #
>>  # @name: name of the sink/source to use
>>  #
>> +# @channel-map: channel map to use (default: OSS compatible map)
>> +#
>>  # Since: 4.0
>>  ##
>>  { 'struct': 'AudiodevPaPerDirectionOptions',
>>    'data': {
>> -    '*name': 'str' } }
>> +    '*name':        'str',
>> +    '*channel-map': 'str' } }
> 
> Ah, I see.  Thats why patch #1 creates a AudiodevPaPerDirectionOptions
> struct with just one field ...

Yes, I was bitten by it too during a refactor, probably I should write a
few words about it in the commit message.

However, this is the exact reason I'd recommend nested structs instead
of randomly flattening it when we can.  This way, if we later have to
add an extra option, we don't end up in a problematic situation, since
we can't easily change things like 'dev-in' to a structure without
breaking backward compatibility.

Regards,
Zoltan

Reply via email to