]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: Verify if a controller is enabled for a v2 cgroup 13/head
authorTom Hromatka <tom.hromatka@oracle.com>
Wed, 23 Sep 2020 16:41:32 +0000 (10:41 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 15 Oct 2020 19:43:09 +0000 (13:43 -0600)
commit9fe521f7f084615b3355cb4e10c8288959d50daa
treeb4bbaf8a8113725107033ec1d8ea197e2c8ef12d
parent1a28481d680e696b872b689f2613e4a236746ff2
api.c: Verify if a controller is enabled for a v2 cgroup

Add a function, cgroupv2_controller_enabled(), that checks if the
requested cgroup v2 controller can be used for the specified path.
Again, in cgroup v2, to use a controller, it must be added to the
parent cgroup's cgroup.subtree_control file.

This check is required to ensure that the cgexec and cgclassify
operations will succeed.  And with this commit, cgexec and cgclassify
work on both cgroup v1 and cgroup v2 hierarchies.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
src/api.c
src/libcgroup-internal.h