]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/cgroups/cgfs.c
cgroup: re-introduce ns cgroup support
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 11 Sep 2013 16:50:54 +0000 (11:50 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 11 Sep 2013 18:58:59 +0000 (13:58 -0500)
commit692ba18faeb83e1a92743c198484f18b4fc18bc5
tree288a8c79ec9166b5ff20d62bbe5855b10caa6189
parentc3cb8580407b6f6b49949e6c58e175eec81db692
cgroup: re-introduce ns cgroup support

If a cgroup hierarchy has ns cgroup composed, then we need to treat
that differently:

1. The container init will have already been switched to a new cgroup
called after its pid.
2. We can't move the container init to new deeper cgroup directories.

So, if we detect an ns cgroup, don't bother trying to construct a new
name according to the pattern.  Just rename the current one to the
container name, and save that path for us to later enter and remove.

Note I'm not dealing with the subpaths so nested containers probably
won't work.  However as ns cgroup is very much legacy, that should be
ok.  Eventually we should be able to drop ns cgroup support altogether,
but not just yet.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/cgroup.c
src/lxc/cgroup.h
src/lxc/start.c