mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
qapi, audio: Make introspection reflect build configuration more closely
Currently the -audiodev accepts any audiodev type regardless of what is built in to QEMU. An error only occurs later at runtime when a sound device tries to use the audio backend. With this change QEMU will immediately reject -audiodev args that are not compiled into the binary. The QMP schema will also be introspectable to identify what is compiled in. This also helps to avoid compiling code that is not required in the binary. Note: When building the audiodevs as modules, the patch only compiles out code for modules that we don't build at all. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> [thuth: Rebase, take sndio and dbus devices into account] Message-Id: <20230123083957.20349-3-thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
637d18090e
commit
7a92a8573c
4 changed files with 112 additions and 13 deletions
|
@ -408,8 +408,18 @@
|
|||
# Since: 4.0
|
||||
##
|
||||
{ 'enum': 'AudiodevDriver',
|
||||
'data': [ 'none', 'alsa', 'coreaudio', 'dbus', 'dsound', 'jack', 'oss', 'pa',
|
||||
'sdl', 'sndio', 'spice', 'wav' ] }
|
||||
'data': [ 'none',
|
||||
{ 'name': 'alsa', 'if': 'CONFIG_AUDIO_ALSA' },
|
||||
{ 'name': 'coreaudio', 'if': 'CONFIG_AUDIO_COREAUDIO' },
|
||||
{ 'name': 'dbus', 'if': 'CONFIG_DBUS_DISPLAY' },
|
||||
{ 'name': 'dsound', 'if': 'CONFIG_AUDIO_DSOUND' },
|
||||
{ 'name': 'jack', 'if': 'CONFIG_AUDIO_JACK' },
|
||||
{ 'name': 'oss', 'if': 'CONFIG_AUDIO_OSS' },
|
||||
{ 'name': 'pa', 'if': 'CONFIG_AUDIO_PA' },
|
||||
{ 'name': 'sdl', 'if': 'CONFIG_AUDIO_SDL' },
|
||||
{ 'name': 'sndio', 'if': 'CONFIG_AUDIO_SNDIO' },
|
||||
{ 'name': 'spice', 'if': 'CONFIG_SPICE' },
|
||||
'wav' ] }
|
||||
|
||||
##
|
||||
# @Audiodev:
|
||||
|
@ -432,16 +442,26 @@
|
|||
'discriminator': 'driver',
|
||||
'data': {
|
||||
'none': 'AudiodevGenericOptions',
|
||||
'alsa': 'AudiodevAlsaOptions',
|
||||
'coreaudio': 'AudiodevCoreaudioOptions',
|
||||
'dbus': 'AudiodevGenericOptions',
|
||||
'dsound': 'AudiodevDsoundOptions',
|
||||
'jack': 'AudiodevJackOptions',
|
||||
'oss': 'AudiodevOssOptions',
|
||||
'pa': 'AudiodevPaOptions',
|
||||
'sdl': 'AudiodevSdlOptions',
|
||||
'sndio': 'AudiodevSndioOptions',
|
||||
'spice': 'AudiodevGenericOptions',
|
||||
'alsa': { 'type': 'AudiodevAlsaOptions',
|
||||
'if': 'CONFIG_AUDIO_ALSA' },
|
||||
'coreaudio': { 'type': 'AudiodevCoreaudioOptions',
|
||||
'if': 'CONFIG_AUDIO_COREAUDIO' },
|
||||
'dbus': { 'type': 'AudiodevGenericOptions',
|
||||
'if': 'CONFIG_DBUS_DISPLAY' },
|
||||
'dsound': { 'type': 'AudiodevDsoundOptions',
|
||||
'if': 'CONFIG_AUDIO_DSOUND' },
|
||||
'jack': { 'type': 'AudiodevJackOptions',
|
||||
'if': 'CONFIG_AUDIO_JACK' },
|
||||
'oss': { 'type': 'AudiodevOssOptions',
|
||||
'if': 'CONFIG_AUDIO_OSS' },
|
||||
'pa': { 'type': 'AudiodevPaOptions',
|
||||
'if': 'CONFIG_AUDIO_PA' },
|
||||
'sdl': { 'type': 'AudiodevSdlOptions',
|
||||
'if': 'CONFIG_AUDIO_SDL' },
|
||||
'sndio': { 'type': 'AudiodevSndioOptions',
|
||||
'if': 'CONFIG_AUDIO_SNDIO' },
|
||||
'spice': { 'type': 'AudiodevGenericOptions',
|
||||
'if': 'CONFIG_SPICE' },
|
||||
'wav': 'AudiodevWavOptions' } }
|
||||
|
||||
##
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue