Daniel P. Berrange a09fc2
diff -rup libvirt-0.6.1.orig/src/qemu_conf.c libvirt-0.6.1.new/src/qemu_conf.c
Daniel P. Berrange a09fc2
--- libvirt-0.6.1.orig/src/qemu_conf.c	2009-03-17 11:57:04.000000000 +0000
Daniel P. Berrange a09fc2
+++ libvirt-0.6.1.new/src/qemu_conf.c	2009-03-17 15:50:08.000000000 +0000
Daniel P. Berrange a09fc2
@@ -757,6 +757,20 @@ int qemudBuildCommandLine(virConnectPtr 
Daniel P. Berrange a09fc2
     char uuid[VIR_UUID_STRING_BUFLEN];
Daniel P. Berrange a09fc2
     char domid[50];
Daniel P. Berrange a09fc2
     char *pidfile;
Daniel P. Berrange a09fc2
+    int skipSound = 0;
Daniel P. Berrange a09fc2
+
Daniel P. Berrange a09fc2
+    if (driver->securityDriver &&
Daniel P. Berrange a09fc2
+        driver->securityDriver->name &&
Daniel P. Berrange a09fc2
+        STREQ(driver->securityDriver->name, "selinux") &&
Daniel P. Berrange b59e64
+        getuid() == 0) {
Daniel P. Berrange a09fc2
+        static int soundWarned = 0; 
Daniel P. Berrange a09fc2
+        skipSound = 1;
Daniel P. Berrange a09fc2
+        if (vm->def->nsounds &&
Daniel P. Berrange a09fc2
+            !soundWarned) {
Daniel P. Berrange a09fc2
+            soundWarned = 1;
Daniel P. Berrange a09fc2
+            VIR_WARN0("Sound cards for VMs are disabled while SELinux security model is active");
Daniel P. Berrange a09fc2
+        }
Daniel P. Berrange a09fc2
+    }
Daniel P. Berrange a09fc2
 
Daniel P. Berrange a09fc2
     uname_normalize(&ut);
Daniel P. Berrange a09fc2
 
Daniel P. Berrange a09fc2
@@ -1364,7 +1378,8 @@ int qemudBuildCommandLine(virConnectPtr 
Daniel P. Berrange a09fc2
     }
Daniel P. Berrange a09fc2
 
Daniel P. Berrange a09fc2
     /* Add sound hardware */
Daniel P. Berrange a09fc2
-    if (vm->def->nsounds) {
Daniel P. Berrange a09fc2
+    if (vm->def->nsounds &&
Daniel P. Berrange a09fc2
+        !skipSound) {
Daniel P. Berrange a09fc2
         int size = 100;
Daniel P. Berrange a09fc2
         char *modstr;
Daniel P. Berrange a09fc2
         if (VIR_ALLOC_N(modstr, size+1) < 0)
Daniel P. Berrange a09fc2
Only in libvirt-0.6.1.new/src: qemu_conf.c~