[libvirt] [PATCH] qemu: Allow using regular audio backends with VNC

Daniel P. Berrange berrange at redhat.com
Mon May 24 14:31:58 UTC 2010


On Mon, May 24, 2010 at 10:26:43AM -0400, Cole Robinson wrote:
> On 05/24/2010 10:14 AM, Daniel P. Berrange wrote:
> > On Thu, May 20, 2010 at 12:04:04PM -0400, Cole Robinson wrote:
> >> Currently all host audio backends are disabled if a VM is using VNC, in
> >> favor of the QEMU VNC audio extension. Unfortunately no released VNC
> >> client supports this extension, so users have no way of getting audio
> >> to work if using VNC.
> >>
> >> Add a new config option in qemu.conf which allows changing libvirt's
> >> behavior, but keep the default intact.
> >>
> >> Signed-off-by: Cole Robinson <crobinso at redhat.com>
> >> ---
> >>  src/qemu/qemu.conf   |   10 ++++++++++
> >>  src/qemu/qemu_conf.c |   17 ++++++++++++-----
> >>  src/qemu/qemu_conf.h |    2 ++
> >>  3 files changed, 24 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/src/qemu/qemu.conf b/src/qemu/qemu.conf
> >> index 3da332f..fec946d 100644
> >> --- a/src/qemu/qemu.conf
> >> +++ b/src/qemu/qemu.conf
> >> @@ -168,3 +168,13 @@
> >>  # be assigned to guests.
> >>  #
> >>  # relaxed_acs_check = 1
> >> +
> >> +
> >> +# QEMU implements anextension for providing audio over a VNC connection,
> >> +# though if your VNC client does not support it, your only chance for getting
> >> +# sound output is through regular audio backends. By default, libvirt will
> >> +# disable all QEMU sound backends if using VNC, since they can cause
> >> +# permissions issues. Enabling this option will make libvirtd honor the
> >> +# QEMU_AUDIO_DRV environment variable when using VNC.
> >> +#
> >> +# vnc_enable_audio_backend = 0
> > 
> > I think this would be better named as 'vnc_allow_host_audio'
> > since its not toggling VNC audio, just whether it is allowed
> > to use the host audio drivers. 
> > 
> 
> Okay, I'll change and resend.
> 
> > NB, even with this toggled things are unlikely to magically
> > 'just work'. If QEMU is running as 'qemu' user ID, that user
> > won't have any permissions to use /dev/snd/* devices. And
> > if running as 'root' then pulseaudio won't autospawn so will
> > need to be run manually.
> > 
> 
> Right. Currently getting sound to work in Fedora is a big pain, and
> there have been quite a few user complaints. I'm going to write up a
> 'known bug' page, documenting a workaround of qemu.conf user/group =
> $USER to fix the issue, but this patch will still need to be backported.

I'd really recommend against telling people to configure libvirt to run
the guests as their own $USER because that'll open a huge can of worms.

Better to tell them to add an ACL to /dev/snd/* using setfacl to add the
qemu user to the ACL for the sound card, or drop in a udev rule todo the
same.


Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list