conf: Introduce support for virtio-sound devices

This patch adds parsing of the virtio sound model, along with parsing
of virtio options and PCI/virtio-mmio address assignment.

A new 'streams' attribute is added for configuring number of PCM streams
(default is 2) in virtio sound devices. QEMU additionally has jacks and chmaps
parameters but these are currently stubbed, hence they are excluded in this
patch series.

Signed-off-by: Rayhan Faizel <rayhan.faizel@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Rayhan Faizel
2024-04-12 01:42:43 +05:30
committed by Ján Tomko
parent 9081320b53
commit bb593e3743
9 changed files with 80 additions and 3 deletions

View File

@@ -7405,8 +7405,9 @@ A virtual sound card can be attached to the host via the ``sound`` element.
what real sound device is emulated. Valid values are specific to the
underlying hypervisor, though typical choices are ``sb16``, ``es1370``,
``pcspk``, ``ac97`` (:since:`Since 0.6.0`), ``ich6`` (:since:`Since 0.8.8`),
``ich9`` (:since:`Since 1.1.3`), ``usb`` (:since:`Since 1.2.8`) and ``ich7``
(:since:`Since 6.7.0`, bhyve only).
``ich9`` (:since:`Since 1.1.3`), ``usb`` (:since:`Since 1.2.8`), ``ich7``
(:since:`Since 6.7.0`, bhyve only) and ``virtio``
(:since:`Since 10.4.0 and QEMU 8.2.0`).
:since:`Since 0.9.13`, a sound element with ``ich6`` or ``ich9`` models can have
optional sub-elements ``<codec>`` to attach various audio codecs to the audio
@@ -7434,6 +7435,12 @@ multi-channel mode by using the ``multichannel`` attribute::
<sound model='usb' multichannel='yes'/>
:since:`Since 10.4.0 and QEMU 8.2.0` the number of PCM streams in a ``virtio``
sound device can be configured by using the ``streams`` attribute, which
defaults to ``2`` if left unspecified::
<sound model='virtio' streams='2'/>
Each ``sound`` element has an optional sub-element ``<address>`` which can tie
the device to a particular PCI slot. See `Device Addresses`_.