[RFC PATCH 3/6] LXC: only mount cgroupfs when userns is disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since we can't mount cgroupfs in uninit user namespace
now. only mount cgroupfs when userns is disabled.

Signed-off-by: Gao feng <gaofeng@xxxxxxxxxxxxxx>
---
 src/lxc/lxc_container.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 5c66ae3..92af3e5 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -1979,7 +1979,8 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
 
     /* Now we can re-mount the cgroups controllers in the
      * same configuration as before */
-    if (lxcContainerMountCGroups(mounts, nmounts,
+    if (vmDef->os.userns != VIR_DOMAIN_USER_NS_ENABLED &&
+        lxcContainerMountCGroups(mounts, nmounts,
                                  cgroupRoot, sec_mount_options) < 0)
         goto cleanup;
 
@@ -2087,7 +2088,8 @@ static int lxcContainerSetupExtraMounts(virDomainDefPtr vmDef,
 
     /* Now we can re-mount the cgroups controllers in the
      * same configuration as before */
-    if (lxcContainerMountCGroups(mounts, nmounts,
+    if (vmDef->os.userns != VIR_DOMAIN_USER_NS_ENABLED &&
+        lxcContainerMountCGroups(mounts, nmounts,
                                  cgroupRoot, sec_mount_options) < 0)
         goto cleanup;
 
-- 
1.7.11.7

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]