From f9d42801456f1c70c942d3edb0d0ac9266dde9fc Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 13 Apr 2016 11:00:11 +0100 Subject: [PATCH] virt-login-shell: add ability to join the container cgroups Prior to joining the namespaces of the container, move the process into the containers' cgroups, so that the shell that is subsequently launched is under the container resource constraints. Signed-off-by: Daniel P. Berrange --- tools/virt-login-shell.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/virt-login-shell.c b/tools/virt-login-shell.c index dc3d3e371b..38fcb9e38f 100644 --- a/tools/virt-login-shell.c +++ b/tools/virt-login-shell.c @@ -355,6 +355,8 @@ main(int argc, char **argv) goto cleanup; if (virDomainLxcEnterSecurityLabel(secmodel, seclabel, NULL, 0) < 0) goto cleanup; + if (virDomainLxcEnterCGroup(dom, 0) < 0) + goto cleanup; if (nfdlist > 0 && virDomainLxcEnterNamespace(dom, nfdlist, fdlist, NULL, NULL, 0) < 0) goto cleanup;