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.
This commit is contained in:
Anton Fadeev 2023-06-28 15:14:08 +03:00 committed by antonios-f
parent d7fb8deb6a
commit 971753af89

View File

@ -3920,8 +3920,10 @@ qemuDomainDefSuggestDefaultAudioBackend(virQEMUDriver *driver,
audioPassthrough = true; audioPassthrough = true;
} else { } else {
audioPassthrough = false; audioPassthrough = false;
if (!*addAudio) {
*audioBackend = VIR_DOMAIN_AUDIO_TYPE_NONE; *audioBackend = VIR_DOMAIN_AUDIO_TYPE_NONE;
} }
}
*addAudio = true; *addAudio = true;
break; break;
case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: case VIR_DOMAIN_GRAPHICS_TYPE_SPICE: