diff mbox series

[13/13] audio: forbid default audiodev backend with -nodefaults

Message ID 20230923085507.399260-14-pbonzini@redhat.com
State New
Headers show
Series Cleanup deprecated audio features, take 2 | expand

Commit Message

Paolo Bonzini Sept. 23, 2023, 8:55 a.m. UTC
Now that all callers support setting an audiodev, forbid using the default
audiodev if -nodefaults is provided on the command line.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 audio/audio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/audio/audio.c b/audio/audio.c
index 7dd95018a05..3489fd07b20 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1804,7 +1804,7 @@  static AudioState *audio_init(Audiodev *dev)
 bool AUD_register_card (const char *name, QEMUSoundCard *card, Error **errp)
 {
     if (!card->state) {
-        if (!QSIMPLEQ_EMPTY(&audiodevs)) {
+        if (!QSIMPLEQ_EMPTY(&audiodevs) || !defaults_enabled()) {
             error_setg(errp, "No audiodev specified for %s", name);
             return false;
         }