[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 13/13] audio: forbid default audiodev backend with -nodefaults
From: |
Paolo Bonzini |
Subject: |
[PATCH 13/13] audio: forbid default audiodev backend with -nodefaults |
Date: |
Thu, 28 Sep 2023 09:36:57 +0200 |
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 | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index bc837cb2ff2..868164373e1 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1806,10 +1806,12 @@ 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);
- error_append_hint(errp, "Perhaps you wanted to set audiodev=%s?",
- QSIMPLEQ_FIRST(&audiodevs)->dev->id);
+ if (!QSIMPLEQ_EMPTY(&audiodevs)) {
+ error_append_hint(errp, "Perhaps you wanted to set
audiodev=%s?",
+ QSIMPLEQ_FIRST(&audiodevs)->dev->id);
+ }
return false;
}
--
2.41.0
- [PATCH 01/13] ui/vnc: Require audiodev= to enable audio, (continued)
- [PATCH 01/13] ui/vnc: Require audiodev= to enable audio, Paolo Bonzini, 2023/09/28
- [PATCH 04/13] audio: return Error ** from audio_state_by_name, Paolo Bonzini, 2023/09/28
- [PATCH 05/13] audio: commonize voice initialization, Paolo Bonzini, 2023/09/28
- [PATCH 06/13] audio: simplify flow in audio_init, Paolo Bonzini, 2023/09/28
- [PATCH 08/13] Introduce machine property "audiodev", Paolo Bonzini, 2023/09/28
- [PATCH 07/13] audio: remove QEMU_AUDIO_* and -audio-help support, Paolo Bonzini, 2023/09/28
- [PATCH 10/13] hw/ppc: Support machine-default audiodev with fallback, Paolo Bonzini, 2023/09/28
- [PATCH 09/13] hw/arm: Support machine-default audiodev with fallback, Paolo Bonzini, 2023/09/28
- [PATCH 11/13] vt82c686: Support machine-default audiodev with fallback, Paolo Bonzini, 2023/09/28
- [PATCH 13/13] audio: forbid default audiodev backend with -nodefaults,
Paolo Bonzini <=
- [PATCH 12/13] audio: forbid mixing default audiodev backend and -audiodev, Paolo Bonzini, 2023/09/28