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 <a.lauterer@proxmox.com>
This commit is contained in:
Aaron Lauterer 2020-03-16 11:02:38 +01:00 committed by Thomas Lamprecht
parent 818c3b8d91
commit 940e2a3a06

View File

@ -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!";
}