From 971753af89a66c7a4bb23c153012a9e0983784a3 Mon Sep 17 00:00:00 2001 From: Anton Fadeev Date: Wed, 28 Jun 2023 15:14:08 +0300 Subject: [PATCH] src/qemu/qemu_domain.c: Fix overriding audioBackend in qemuDomainDefSuggestDefaultAudioBackend If we have Spice and VNC graphics in domain XML, and Spice graphics defined before VNC, audioBackend will be overrided in qemuDomainDefSuggestDefaultAudioBackend to VIR_DOMAIN_AUDIO_TYPE_NONE, and we will have no sound in Spice session, like this https://bugs.launchpad.net/qemu/+bug/1900352. If the flag addAudio already set, we do not need to override audioBackend. This commit fix the issue. --- src/qemu/qemu_domain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 94587638c3..7a03603218 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -3920,7 +3920,9 @@ qemuDomainDefSuggestDefaultAudioBackend(virQEMUDriver *driver, audioPassthrough = true; } else { audioPassthrough = false; - *audioBackend = VIR_DOMAIN_AUDIO_TYPE_NONE; + if (!*addAudio) { + *audioBackend = VIR_DOMAIN_AUDIO_TYPE_NONE; + } } *addAudio = true; break;