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: Gerd Hoffmann
Subject: Re: Let's remove some deprecated stuff
Date: Thu, 29 Apr 2021 14:40:49 +0200

  Hi,

> For this to go away, I'd rather have something like the -nic option that
> provides an easy way to set up the front end and back end.
> 
> 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:

--- a/qapi/audio.json
+++ b/qapi/audio.json
@@ -419,3 +419,22 @@
     'sdl':       'AudiodevSdlOptions',
     'spice':     'AudiodevGenericOptions',
     'wav':       'AudiodevWavOptions' } }
+
+##
+# @AudioDevice:
+#
+# TODO
+##
+{ 'enum': 'AudioDevice',
+  'data': [ 'pcspk', 'ac97', 'hda' ] }
+
+##
+# @AudioConfig:
+#
+# TODO
+##
+{ 'struct': 'AudioConfig',
+  'base': 'Audiodev',
+  'data': {
+    'model': 'AudioDevice'
+}}

But qemu doesn't like the schema:
qapi/audio.json: In struct 'AudioConfig':
qapi/audio.json:436: 'base' requires a struct type, union type 'Audiodev' isn't

We could easily support the case that no additional options are
specified, like this:

+{ 'struct': 'AudioConfig',
+  'data': {
+    'driver': 'AudiodevDriver',
+    'model': 'AudioDevice'
+}}

But then you have to switch to the long form as soon as you want
specify any audiodev config option.  Maybe that is ok, dunno how
much configuration options -nic supports.

take care,
  Gerd




reply via email to

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