]> git.ipfire.org Git - thirdparty/libcgroup.git/commit
api.c: Add options field for rules defined in cgrules conf file
authorTom Hromatka <tom.hromatka@oracle.com>
Mon, 4 Nov 2019 23:15:11 +0000 (23:15 +0000)
committerTom Hromatka <tom.hromatka@oracle.com>
Thu, 12 Dec 2019 22:10:28 +0000 (15:10 -0700)
commitfbb0489a4780258aa577b9d08274eb0772292d70
tree11f88ccb5c751547d7bf22b2d27fc7b3e0baf435
parentbdd4468fe3781bb51d30e3b23848cc00081122dc
api.c: Add options field for rules defined in cgrules conf file

This commit adds a fourth field called options to the rules
entry in cgrules configuration files.  Note that the field is
optional and existing rules will be parsed exactly as before.

Also, this commit only adds the parsing of the options field.
It doesn't change the rule behavior logic; that will come in
a subsequent commit.

An example cgrules.conf using this feature:

<user>    <controller>    <destination>           <options>
*         cpu             MyCgroup                ignore
*         cpu             DefaultCgroup

In the above example (and once the subsequent processing is
added), any process currently in the cpu controller and
MyCgroup will be ignored by cgrulesengd.  In other words,
cgrules will not try to move these processes to another cgroup
or manage them in any fashion.  It is anticipated that a
separate user process (outside of the scope of libcgroup) will
manage pids in this scenario.

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