From 4797e8f7bc4fb7ac801a7fb2b99bcbd00a2da45f Mon Sep 17 00:00:00 2001
From: Russell Bryant <rbryant@redhat.com>
Date: Fri, 7 Sep 2012 11:09:06 -0400
Subject: [PATCH] Set virt_use_execmem boolean if SELinux is enabled.

If SELinux is enabled, this boolean is required to be able to launch VMs using qemu.
Set the boolean if we're switching the libvirt_type to 'qemu' and SELinux is enabled.

Change-Id: Ieead35aae94c9fa86df1f4829584f71c97dcbeb8
---
 stack.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/stack.sh b/stack.sh
index 665a366339..5c27462aa3 100755
--- a/stack.sh
+++ b/stack.sh
@@ -1345,6 +1345,10 @@ if is_service_enabled n-cpu; then
         if [ ! -e /dev/kvm ]; then
             echo "WARNING: Switching to QEMU"
             LIBVIRT_TYPE=qemu
+            if which selinuxenabled 2>&1 > /dev/null && selinuxenabled; then
+                # https://bugzilla.redhat.com/show_bug.cgi?id=753589
+                sudo setsebool virt_use_execmem on
+            fi
         fi
     fi