virt-install: Add support for multi-channel mode for 'usb' sound card

E.g.
    virt-install \
    ... \
    --sound model=usb,multichannel=yes

  It results in the following domain xml:
  <sound model="usb" multichannel="yes"/>

Signed-off-by: Lin Ma <lma@suse.de>
This commit is contained in:
Lin Ma 2024-11-13 15:04:10 +08:00 committed by Pavel Hrdina
parent 1c0f7f62e8
commit e883e7d525
4 changed files with 4 additions and 0 deletions

View File

@ -806,6 +806,7 @@
<codec type="duplex"/>
<codec type="output"/>
</sound>
<sound model="usb" multichannel="yes"/>
<audio type="spice" id="1"/>
<audio type="pulseaudio" id="2"/>
<video>

View File

@ -749,6 +749,7 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser
--soundhw default
--sound ac97
--sound codec0.type=micro,codec1.type=duplex,codec2.type=output
--sound model=usb,multichannel=yes
--audio id=1,type=spice

View File

@ -4774,6 +4774,7 @@ class ParserSound(VirtCLIParser):
cls.add_arg("audio.id", "audio_id")
cls.add_arg("codec[0-9]*.type", "type",
find_inst_cb=cls.codec_find_inst_cb)
cls.add_arg("multichannel", "multichannel")
class ParserAudio(VirtCLIParser):

View File

@ -23,6 +23,7 @@ class DeviceSound(Device):
model = XMLProperty("./@model")
codecs = XMLChildProperty(_Codec)
audio_id = XMLProperty("./audio/@id")
multichannel = XMLProperty("./@multichannel", is_yesno=True)
##################