]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix start of containers with custom root filesystem
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 25 Sep 2012 15:24:10 +0000 (16:24 +0100)
committerCole Robinson <crobinso@redhat.com>
Wed, 17 Oct 2012 20:19:35 +0000 (16:19 -0400)
A prefix change to unmount the SELinux filesystem broke starting
of LXC containers with a custom root filesystem
(cherry picked from commit 1532bd498a879494bb1e4757a54fce796eab368c)

src/lxc/lxc_container.c

index a749d244235633c977240ca0561ed54c048f273f..4bb2affdb1e75a1ad92b535452f0ecf7069fa2c3 100644 (file)
@@ -1191,6 +1191,8 @@ static int lxcContainerGetSubtree(const char *prefix,
     char **mounts = NULL;
     size_t nmounts = 0;
 
+    VIR_DEBUG("prefix=%s", prefix);
+
     *mountsret = NULL;
     *nmountsret = 0;
 
@@ -1528,7 +1530,8 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
     /* Some versions of Linux kernel don't let you overmount
      * the selinux filesystem, so make sure we kill it first
      */
-    if (lxcContainerUnmountSubtree(SELINUX_MOUNT, false) < 0)
+    if (STREQ(root->src, "/") &&
+        lxcContainerUnmountSubtree(SELINUX_MOUNT, false) < 0)
         goto cleanup;
 #endif