From: Daniel P. Berrange Date: Wed, 13 Apr 2016 10:00:11 +0000 (+0100) Subject: virt-login-shell: add ability to join the container cgroups X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f9d42801456f1c70c942d3edb0d0ac9266dde9fc;p=libvirt.git 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 --- 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;