]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
cgconfig: Add support for multiple controllers on the same mount path
authorlipengyu <lipengyu@kylinos.cn>
Fri, 6 Dec 2024 05:08:17 +0000 (10:38 +0530)
committerKamalesh Babulal <kamalesh.babulal@oracle.com>
Fri, 6 Dec 2024 05:38:19 +0000 (11:08 +0530)
commitdcce65bde49dd86046ffd87091cfd17b2af81be5
treeacc0078bd8fa65dcaee5b1508e097c0e5e989447
parent61f8efbdb4712186bffd968f3fc5b251f7b967d9
cgconfig: Add support for multiple controllers on the same mount path

Add support to cgconfigparser for mounting multiple controllers to the
same mount point.

Given the following config:

mount {
cpu = /cg_sys;
cpuacct = /cg_sys;
}

cgconfigparser should mount both the cpu and cpuacct controllers to
/cg_sys. The mount should look as follows:

cgroup on /cg_sys type cgroup (rw,relatime,seclabel,cpu,cpuacct)

Without this change, the mount->name gets overwritten and the mount
fails, which can be categorized into two cases:

1.if cpu and cpuacct are at the same hierarchy before being mounted:

Error: cannot mount cpu to /cg_sys: Device or resource busy

2.if cpu and cpuacct are not at the same hierarchy before being mounted:

cgroup on /cg_sys type cgroup (rw,relatime,seclabel,cpu)

[TJH suggested improvements to commit message]
[Kamalesh fixed a few checkpatch warnings]
Signed-off-by: lipengyu <lipengyu@kylinos.cn>
Acked-by: Tom Hromatka <tom.hromatka@oracle.com>
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
src/config.c