[libvirt] [PATCH 3/6] qemu: explicitly disable audio if there is no sound device

Pavel Hrdina phrdina at redhat.com
Tue Nov 21 11:57:36 UTC 2017


On Tue, Nov 21, 2017 at 11:24:06AM +0000, Daniel P. Berrange wrote:
> On Tue, Nov 14, 2017 at 02:45:08PM +0100, Pavel Hrdina wrote:
> > If there is no sound device configured for the guest we can disable the
> > audio output because hot-plugging sound devices isn't supported.
> 
> Are you sure about that. While libvirt may not have wired up ability to
> hotplug sound devices, I'm pretty sure that QEMU is able to hotplug
> them.
> 
> Ff libvirt forceably disables the audio backend, now, and then future
> libvirt enables the pre-existing QEMU support for hotplug, existing VMs
> will be doomed.
> 
> IOW, I don't think this patch is desirable.

Right, I meant from libvirt POV.  Anyway, if we allow to hot-plug sound
device, you have no control where the audio output will be connected.
Configuration of audio output is really stupid in QEMU.  You need to use
environment variable, you have only one so you cannot configure
different sound devices to have different audio output and from
documentation it is not clear what is the default if you don't set the
QEMU_AUDIO_DRV.  Checking the code gives you headache :).

The default audio output depends on what audio drivers are enabled and
compiled in QEMU and on the order of the audio drivers, these can be
used as default: alsa, dsound, core, none, oss, pa, sdl, spice
(if there is spice graphics).

So based on all of the findings, if we allow hot-plugging sound device
and the QEMU_AUDIO_DRV is not configured in advance there is no way how
you can configure the audio output and no way how we can tell which one
will be the default.

I would rather have this limitation that you should start the domain
with sound device configured instead of allowing hot-plug since the
audio output design in QEMU is foobar.

Pavel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20171121/224980f1/attachment-0001.sig>


More information about the libvir-list mailing list