[1/3] libvzctl-4.14: clone CT in new cgroup namespace

Submitted by Stanislav Kinsburskiy on Jan. 10, 2018, 4:15 p.m.

Details

Message ID 20180110161525.12838.32953.stgit@skinsbursky-vz7.qa.sw.ru
State New
Series "libvzctl: a set a patches to make CT running on 4.14 kernel"
Headers show

Commit Message

Stanislav Kinsburskiy Jan. 10, 2018, 4:15 p.m.
We are going to use it along with all the other namespaces.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
 lib/env_nsops.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/env_nsops.c b/lib/env_nsops.c
index 13e65b0..0771eb2 100644
--- a/lib/env_nsops.c
+++ b/lib/env_nsops.c
@@ -807,8 +807,10 @@  static int do_env_create(struct vzctl_env_handle *h, struct start_param *param)
 		}
 		param->init_p = init_p;
 
+#define CLONE_NEWCGROUP         0x02000000      /* New cgroup namespace */
+
 		clone_flags |= CLONE_NEWUTS|CLONE_NEWPID|CLONE_NEWIPC|
-			CLONE_NEWNET|CLONE_NEWNS|CLONE_NEWUSER;
+			CLONE_NEWNET|CLONE_NEWNS|CLONE_NEWUSER|CLONE_NEWCGROUP;
 		pid = clone(real_ns_env_create,
 				child_stack + sizeof(child_stack),
 				clone_flags|SIGCHLD , (void *) param);