libvirt/libvirt-0.6.2-svirt-sound.patch
Mark McLoughlin 7b23a93c36 * Mon Oct 19 2009 Mark McLoughlin <markmc@redhat.com> - 0.6.2-19
- Ignore re-labelling errors on NFS (#517157)
2009-10-19 11:15:16 +00:00

52 lines
1.5 KiB
Diff

From 2fcd18b6a39f495d84eb3ef56a49994621c8f7d3 Mon Sep 17 00:00:00 2001
From: Daniel P. Berrange <berrange@redhat.com>
Date: Mon, 17 Aug 2009 08:52:30 +0100
Subject: [PATCH] Disable sound cards when running sVirt
Temporary hack till PulseAudio autostart problems are sorted out when
SELinux enforcing (bz 486112)
Fedora-patch: libvirt-0.6.2-svirt-sound.patch
---
src/qemu_conf.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
index d76b2b6..22c5363 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -885,6 +885,20 @@ int qemudBuildCommandLine(virConnectPtr conn,
char domid[50];
char *pidfile;
const char *cpu = NULL;
+ int skipSound = 0;
+
+ if (driver->securityDriver &&
+ driver->securityDriver->name &&
+ STREQ(driver->securityDriver->name, "selinux") &&
+ getuid() == 0) {
+ static int soundWarned = 0;
+ skipSound = 1;
+ if (vm->def->nsounds &&
+ !soundWarned) {
+ soundWarned = 1;
+ VIR_WARN0("Sound cards for VMs are disabled while SELinux security model is active");
+ }
+ }
uname_normalize(&ut);
@@ -1531,7 +1545,8 @@ int qemudBuildCommandLine(virConnectPtr conn,
}
/* Add sound hardware */
- if (vm->def->nsounds) {
+ if (vm->def->nsounds &&
+ !skipSound) {
int size = 100;
char *modstr;
if (VIR_ALLOC_N(modstr, size+1) < 0)
--
1.6.2.5