[libvirt] [PATCH] Fixed connection definition for non-SELinux builds

Martin Kletzander mkletzan at redhat.com
Fri Feb 3 15:03:18 UTC 2012

This patch fixes the access of variable "con" in two files where the
variable was declared only on SELinux builds and thus the build failed
without SELinux. It's a rather nasty fix but helps fix the build
quickly and without any major changes to the code.
 src/lxc/lxc_container.c  |    2 ++
 src/lxc/lxc_controller.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index d1156e4..1c148e2 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -449,6 +449,8 @@ static int lxcContainerMountBasicFS(const char *srcprefix, bool pivotRoot)
     char *opts = NULL;
     security_context_t con;
+    bool con = false;

     VIR_DEBUG("Mounting basic filesystems %s pivotRoot=%d", NULLSTR(srcprefix), pivotRoot);
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index fedb7c8..8f336f5 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -1438,6 +1438,8 @@ lxcControllerRun(virDomainDefPtr def,
     if (root) {
         security_context_t con;
+        bool con = false;
         char *opts;
         VIR_DEBUG("Setting up private /dev/pts");

More information about the libvir-list mailing list