libvirt/libvirt-0.6.4-svirt-sound.patch

52 lines
1.5 KiB
Diff
Raw Normal View History

From 5f8d720b5f1393ee333a5fa8375ffe9ac954d48b Mon Sep 17 00:00:00 2001
2009-08-17 08:08:46 +00:00
From: Daniel P. Berrange <berrange@redhat.com>
Date: Mon, 17 Aug 2009 08:32:08 +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.4-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 6b0b404..53186e0 100644
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -1384,6 +1384,20 @@ int qemudBuildCommandLine(virConnectPtr conn,
char uuid[VIR_UUID_STRING_BUFLEN];
2009-05-29 17:05:50 +00:00
char domid[50];
const char *cpu = NULL;
+ int skipSound = 0;
+
+ if (driver->securityDriver &&
+ driver->securityDriver->name &&
+ STREQ(driver->securityDriver->name, "selinux") &&
+ getuid() == 0) {
2009-08-17 08:08:46 +00:00
+ static int soundWarned = 0;
2009-05-29 17:05:50 +00:00
+ skipSound = 1;
+ if (def->nsounds &&
+ !soundWarned) {
+ soundWarned = 1;
+ VIR_WARN0("Sound cards for VMs are disabled while SELinux security model is active");
+ }
+ }
uname_normalize(&ut);
2009-08-17 08:08:46 +00:00
@@ -2015,7 +2029,8 @@ int qemudBuildCommandLine(virConnectPtr conn,
2009-05-29 17:05:50 +00:00
}
/* Add sound hardware */
- if (def->nsounds) {
+ if (def->nsounds &&
+ !skipSound) {
int size = 100;
char *modstr;
if (VIR_ALLOC_N(modstr, size+1) < 0)
2009-08-17 08:08:46 +00:00
--
1.6.2.5