]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api: Support NULL controllers[] in cgroup_change_cgroup_path()
authorTom Hromatka <tom.hromatka@oracle.com>
Wed, 17 May 2023 20:46:58 +0000 (14:46 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Tue, 23 May 2023 21:43:05 +0000 (15:43 -0600)
commit4c86b1cd6e615b2356b72df1f13bbccb362bc3db
tree1bb64ce8210bcfa4da3c61fc765ed96c0fed51c6
parent06c6ac43bcc9178f7d06818c1775bf311a58172b
api: Support NULL controllers[] in cgroup_change_cgroup_path()

cgroup_change_cgroup_path() allows the user to move a pid to a
different cgroup (via the cgroup name and not a cgroup struct).
In cgroup v1, it's imperative that the controller(s) are
provided, so that the proper path can be built up.  In cgroup v2,
the list of controllers is optional, since they are not a part
of the path.

Add support for the controllers[] list to be NULL iff we are
running in unified (cgroup v2) mode.

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
src/api.c