summaryrefslogtreecommitdiff
path: root/src/qemu/qemu_command.c
diff options
context:
space:
mode:
authorPeter Krempa <pkrempa@redhat.com>2023-05-09 13:10:30 +0200
committerPeter Krempa <pkrempa@redhat.com>2023-05-09 15:12:03 +0200
commit3d6bc5c61101aadd6fca5d558a44a1cba8120178 (patch)
tree62a702c57ea4b8ba2b2b6a68dbdb7bf4bfb24d9a /src/qemu/qemu_command.c
parent783c6bc2f03c797b06a483fc813ed0f3373e1daa (diff)
downloadlibvirt-3d6bc5c61101aadd6fca5d558a44a1cba8120178.tar.gz
conf: qemu: Add support for multi-channel mode for 'usb' sound cards
Allow users controlling the multi-channel mode by adding a 'multichannel' property parsed for USB audio devices and wire up the support in the qemu driver. Closes: https://gitlab.com/libvirt/libvirt/-/issues/472 Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
Diffstat (limited to 'src/qemu/qemu_command.c')
-rw-r--r--src/qemu/qemu_command.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index dcad449413..2a6d9408f6 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4384,6 +4384,7 @@ qemuBuildSoundDevCmd(virCommand *cmd,
g_autoptr(virJSONValue) props = NULL;
const char *model = NULL;
g_autofree char *audioid = NULL;
+ virTristateBool multichannel = VIR_TRISTATE_BOOL_ABSENT;
switch (sound->model) {
case VIR_DOMAIN_SOUND_MODEL_ES1370:
@@ -4397,6 +4398,7 @@ qemuBuildSoundDevCmd(virCommand *cmd,
break;
case VIR_DOMAIN_SOUND_MODEL_USB:
model = "usb-audio";
+ multichannel = sound->multichannel;
break;
case VIR_DOMAIN_SOUND_MODEL_ICH9:
model = "ich9-intel-hda";
@@ -4419,6 +4421,7 @@ qemuBuildSoundDevCmd(virCommand *cmd,
"s:driver", model,
"s:id", sound->info.alias,
"S:audiodev", audioid,
+ "T:multi", multichannel,
NULL) < 0)
return -1;