]> git.ipfire.org Git - thirdparty/lxc.git/commit
cgroups: support cgroups mounted in multiple places (v3)
authorSerge E. Hallyn <serge@hallyn.com>
Sun, 3 Jul 2011 22:42:06 +0000 (00:42 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Sun, 3 Jul 2011 22:42:06 +0000 (00:42 +0200)
commitbcbd102cba31a0054fe4204a39b5e8a411cde42f
treed361c5132d7ad2f81d1a080b4f3ed66d1e3d2944
parentc840b37de865195a8742e219b4374d961a21d4d9
cgroups: support cgroups mounted in multiple places (v3)

(sorry for the extra traffic.)

With this patch, lxc works for me both with all cgroups mounted with
ns cgroup on /cgroup, and with libcgroup mounting all cgroups
separately.

To do this, instead of looking for one cgroup called 'lxc' or
otherwise taking the first cgroup we find, we actually create a
container in every mounted cgroup fs.  Right now it's done under the
root of each fs.  We may want to put that under lxc, or, better yet,
make that configurable.

Changelog:
  Michael H. Warfield: Handle the case where subsystem doesn't have '.'.
  Daniel Lezcano: clean up incorrect reentrant use of mntent helpers
  v3: use the rest of Daniel's cleanups

TODO: add a configurable directory name, 'lxc' by default, under which
      all lxc cgroups are created (i.e. /sys/fs/cgroup/lxc)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
Tested-by: Michael H. Warfield <mhw@WittsEnd.com>
src/lxc/cgroup.c
src/lxc/cgroup.h
src/lxc/freezer.c
src/lxc/lxc.h
src/lxc/state.c