This patch rewrites most of the cgroup logic. It creates a set of data structures to store the kernel state of the cgroup hierarchies and their mountpoints. Mainly, everything is now grouped with respect to the hierarchies of the system. Multiple controllers may be mounted together or separately to different hierarchies, the data structures reflect this. Each hierarchy may have multiple mount points (that were created previously using the bind mount method) and each of these mount points may point to a different prefix inside the cgroup tree. The current code does not make any assumptions regarding the mount points, it just parses /proc/self/mountinfo to acquire the relevant information. The only requirement is that the current cgroup of either init (if cgroup.pattern starts with '/' and the tools are executed as root) or the current process (otherwise) are accessible. The root cgroup need not be accessible. The configuration option cgroup.pattern is introduced. For root-executed containers, it specifies which format the cgroups should be in. Example values may include '/lxc/%n', 'lxc/%n', '%n' or '/machine/%n.lxc'. Any occurrence of '%n' is replaced with the name of the container (and if clashes occur in any hierarchy, -1, -2, etc. are appended globally). If the pattern starts with /, new containers' cgroups will be located relative to init's cgroup; if it doesn't, they will be located relative to the current process's cgroup. Some changes to the cgroup.h API have been done to make it more consistent, both with respect to naming and with respect to the parameters. This causes some changes in other parts of the code that are included in the patch. There has been some testing of this functionality, but there are probably still quite a few bugs in there, especially for people with different configurations. Signed-off-by:Christian Seiler <christian@iwakd.de> Signed-off-by:
Serge Hallyn <serge.hallyn@ubuntu.com>
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| Makefile.am | Loading commit data... | |
| cgpath.c | Loading commit data... | |
| clonetest.c | Loading commit data... | |
| console.c | Loading commit data... | |
| containertests.c | Loading commit data... | |
| createtest.c | Loading commit data... | |
| destroytest.c | Loading commit data... | |
| get_item.c | Loading commit data... | |
| getkeys.c | Loading commit data... | |
| locktests.c | Loading commit data... | |
| lxc-test-usernic | Loading commit data... | |
| lxcpath.c | Loading commit data... | |
| saveconfig.c | Loading commit data... | |
| shutdowntest.c | Loading commit data... | |
| snapshot.c | Loading commit data... | |
| startone.c | Loading commit data... |