Blob Blame History Raw
diff -rup libvirt-0.6.1.orig/src/qemu_conf.c libvirt-0.6.1.new/src/qemu_conf.c
--- libvirt-0.6.1.orig/src/qemu_conf.c	2009-03-17 11:57:04.000000000 +0000
+++ libvirt-0.6.1.new/src/qemu_conf.c	2009-03-17 15:50:08.000000000 +0000
@@ -757,6 +757,20 @@ int qemudBuildCommandLine(virConnectPtr 
     char uuid[VIR_UUID_STRING_BUFLEN];
     char domid[50];
     char *pidfile;
+    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);
 
@@ -1364,7 +1378,8 @@ int qemudBuildCommandLine(virConnectPtr 
     }
 
     /* 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)
Only in libvirt-0.6.1.new/src: qemu_conf.c~