From 0f957c53c84d655f2e99677d407cf2bbe1832de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Mon, 22 Aug 2022 17:10:21 +0400 Subject: audio: exit(1) if audio backend failed to be found or initialized MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you specify a known backend but it isn't compiled in, or failed to initialize, you get a simple warning and the "none" backend as a fallback, and QEMU runs happily: $ qemu-system-x86_64 -audiodev id=audio,driver=dsound audio: Unknown audio driver `dsound' audio: warning: Using timer based audio emulation ... Instead, QEMU should fail to start: $ qemu-system-x86_64 -audiodev id=audio,driver=dsound audio: Unknown audio driver `dsound' $ Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1983493 Signed-off-by: Marc-AndrĂ© Lureau Reviewed-by: Volker RĂ¼melin Message-Id: <20220822131021.975656-1-marcandre.lureau@redhat.com> --- softmmu/vl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'softmmu') diff --git a/softmmu/vl.c b/softmmu/vl.c index 706bd7c..dea4005 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1885,7 +1885,9 @@ static void qemu_create_early_backends(void) * setting machine properties, so they can be referred to. */ configure_blockdev(&bdo_queue, machine_class, snapshot); - audio_init_audiodevs(); + if (!audio_init_audiodevs()) { + exit(1); + } } -- cgit v1.1