chiark / gitweb /
cgroup: add a new "can_delegate" flag to the unit vtable, and set it for scope and...
authorLennart Poettering <lennart@poettering.net>
Tue, 6 Feb 2018 10:57:35 +0000 (11:57 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:58:54 +0000 (07:58 +0200)
commit801b1cd08dd22c45f14662b8cc7a16e36fbba364
tree2ccbed81013d88ecad646bc7c06a5ceb4376bb04
parent04fa10265f18424ca0ed2f6d2c8ce98196b4a291
cgroup: add a new "can_delegate" flag to the unit vtable, and set it for scope and service units only

Currently we allowed delegation for alluntis with cgroup backing
except for slices. Let's make this a bit more strict for now, and only
allow this in service and scope units.

Let's also add a generic accessor unit_cgroup_delegate() for checking
whether a unit has delegation turned on that checks the new bool first.

Also, when doing transient units, let's explcitly refuse turning on
delegation for unit types that don#t support it. This is mostly
cosmetical as we wouldn't act on the delegation request anyway, but
certainly helpful for debugging.
src/core/cgroup.c
src/core/cgroup.h