This patchset adds cgroup v2 support to cgroup_init() and cg_test_mounted_fs(). For simple cgroup interfaces like cgget and cgset, these were the only changes necessary to add cgroup v2 support to those tools.
I tested the changes by hand on a cgroup v1 mount, a cgroup v2 mount, and the cgroup v2 unified hierarchy. I have started adding cgroup v2 support to the automated test suite, but a lot of work remains. Since the tests have been split into a separate git repo, those patches will come out in a separate patchset. $ sudo ./cgset -r cpu.weight=999 foo $ sudo ./cgget -r cpu.weight foo foo: cpu.weight: 999 Changes from v1 to v2: * Split out the "add cgroup v2 support" patch into four separate patches v1 patchset is available here: https://sourceforge.net/p/libcg/mailman/message/37004989/ Corresponding testing patchset is available here: https://sourceforge.net/p/libcg/mailman/message/37005000/ Code is available on github here: https://github.com/drakenclimber/libcgroup/tree/issues/cgget_v2_v2 Automated test results are here: https://travis-ci.com/github/drakenclimber/libcgroup/builds/165234158 Code coverage increased by 0.8% and is available here: https://coveralls.io/builds/30702420 Tom Hromatka (7): api.c: Refactor cgroup v1 logic in cgroup_init() api.c: Add cgroup version enumeration api.c: Only stat the cgroup tasks file if it's a v1 mount api.c: Add support for cgroup v2 to cg_test_mounted_fs() api.c: cgget: cgset: Add cgroup v2 support api.c: Declare cgroup_process_v1_mnt() as STATIC api.c: Declare cgroup_process_v2_mnt() as STATIC src/api.c | 358 ++++++++++++++++++++++++++------------- src/libcgroup-internal.h | 12 ++ 2 files changed, 255 insertions(+), 115 deletions(-) -- 2.25.3 _______________________________________________ Libcg-devel mailing list Libcg-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libcg-devel