diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2016-04-13 11:00:11 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2016-06-10 11:03:02 +0100 |
commit | f9d42801456f1c70c942d3edb0d0ac9266dde9fc (patch) | |
tree | ada5fa75d0c1d5094ceb02baf01a2d2f7a7c9799 /tools/virt-login-shell.c | |
parent | 18a10ddc1681f3d7ab58470f5c6e2e335767a60f (diff) | |
download | libvirt-f9d42801456f1c70c942d3edb0d0ac9266dde9fc.tar.gz |
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 <berrange@redhat.com>
Diffstat (limited to 'tools/virt-login-shell.c')
-rw-r--r-- | tools/virt-login-shell.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |