SHA256
1
0
forked from pool/qemu
qemu/audio-add-sanity-check.patch
Bruce Rogers 5b17093cb1 Accepting request 860516 from home:bfrogers:branches:Virtualization
- Fix crash when spice used and the qemu-audio-spice package isn't
  installed (boo#1180210)
  audio-add-sanity-check.patch
- Add some stable patches from upstream
  block-Fix-deadlock-in-bdrv_co_yield_to_d.patch
  block-Fix-locking-in-qmp_block_resize.patch
  block-nfs-fix-int-overflow-in-nfs_client.patch
  block-Simplify-qmp_block_resize-error-pa.patch
  build-no-pie-is-no-functional-linker-fla.patch

OBS-URL: https://build.opensuse.org/request/show/860516
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=599
2021-01-05 17:40:44 +00:00

36 lines
1.2 KiB
Diff

From: Gerd Hoffmann <kraxel@redhat.com>
Date: Tue, 15 Dec 2020 09:11:51 +0100
Subject: audio: add sanity check
Git-commit: 06c8c375389a54d8e4457d967f4f0896caecefb2
References: boo#1180210
Check whenever we actually found the spiceaudio driver
before flipping the can_be_default field.
Fixes: f0c4555edfdd ("audio: remove qemu_spice_audio_init()")
Buglink: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=977301
Reported-by: dann frazier <dann.frazier@canonical.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-Id: <20201215081151.20095-1-kraxel@redhat.com>
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
audio/audio.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/audio/audio.c b/audio/audio.c
index 46578e4a583b9ad5c5fd4d40c711..973804620d7b057b70833694947c 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -1709,7 +1709,9 @@ static AudioState *audio_init(Audiodev *dev, const char *name)
* backend and this can go away.
*/
driver = audio_driver_lookup("spice");
- driver->can_be_default = 1;
+ if (driver) {
+ driver->can_be_default = 1;
+ }
}
if (dev) {