From 940e2a3a06b3ea47aae144519e2aaa881a80e437 Mon Sep 17 00:00:00 2001 From: Aaron Lauterer Date: Mon, 16 Mar 2020 11:02:38 +0100 Subject: [PATCH] cfg2cmd: Add the audiodev property to audio devs With Qemu 4.2 a new `audiodev` property was introduced [0] to explicitly specify the backend to be used for the audio device. This is accompanied with a warning that the fallback to the default audio backend is deprecated. [0] https://wiki.qemu.org/ChangeLog/4.2#Audio Signed-off-by: Aaron Lauterer --- PVE/QemuServer.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm index 6445508..417b997 100644 --- a/PVE/QemuServer.pm +++ b/PVE/QemuServer.pm @@ -3256,11 +3256,11 @@ sub config_to_command { my $id = $audio->{dev_id}; if ($audio->{dev} eq 'AC97') { - push @$devices, '-device', "AC97,id=${id}${audiopciaddr}"; + push @$devices, '-device', "AC97,id=${id}${audiopciaddr},audiodev=$audio->{backend_id}"; } elsif ($audio->{dev} =~ /intel\-hda$/) { push @$devices, '-device', "$audio->{dev},id=${id}${audiopciaddr}"; - push @$devices, '-device', "hda-micro,id=${id}-codec0,bus=${id}.0,cad=0"; - push @$devices, '-device', "hda-duplex,id=${id}-codec1,bus=${id}.0,cad=1"; + push @$devices, '-device', "hda-micro,id=${id}-codec0,bus=${id}.0,cad=0,audiodev=$audio->{backend_id}"; + push @$devices, '-device', "hda-duplex,id=${id}-codec1,bus=${id}.0,cad=1,audiodev=$audio->{backend_id}"; } else { die "unkown audio device '$audio->{dev}', implement me!"; } -- 2.39.2