2020-05-08 11:36:57 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
2016-07-01 21:49:54 +02:00
|
|
|
syntax = "proto2";
|
|
|
|
|
2016-01-20 10:27:33 -07:00
|
|
|
message cgroup_perms {
|
|
|
|
required uint32 mode = 1;
|
|
|
|
required uint32 uid = 2;
|
|
|
|
required uint32 gid = 3;
|
|
|
|
}
|
|
|
|
|
2014-08-07 15:26:13 -07:00
|
|
|
message cgroup_prop_entry {
|
|
|
|
required string name = 1;
|
|
|
|
required string value = 2;
|
2016-01-20 10:27:33 -07:00
|
|
|
optional cgroup_perms perms = 3;
|
2014-08-07 15:26:13 -07:00
|
|
|
}
|
|
|
|
|
2014-07-10 17:00:28 +04:00
|
|
|
message cgroup_dir_entry {
|
2014-08-13 13:34:00 +04:00
|
|
|
required string dir_name = 1;
|
2014-08-07 15:26:12 -07:00
|
|
|
repeated cgroup_dir_entry children = 2;
|
2014-08-07 15:26:13 -07:00
|
|
|
repeated cgroup_prop_entry properties = 3;
|
2016-01-20 10:27:35 -07:00
|
|
|
optional cgroup_perms dir_perms = 4;
|
2014-07-10 17:00:28 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
message cg_controller_entry {
|
2014-07-11 15:00:51 +04:00
|
|
|
repeated string cnames = 1;
|
2014-07-11 15:00:43 +04:00
|
|
|
repeated cgroup_dir_entry dirs = 2;
|
2023-03-16 23:05:46 +07:00
|
|
|
optional bool is_threaded = 3;
|
2014-07-10 17:00:28 +04:00
|
|
|
}
|
|
|
|
|
2014-07-03 17:03:00 +04:00
|
|
|
message cg_member_entry {
|
cgroup: add support for cgroup namespaces
cgroup namespaces are imminent to be merged into the kernel (indeed, they
went into and out of 4.5 for minor issues), and will be carried as a
patchset in the ubuntu 16.04 kernel. Here's an attempt at c/r.
There are essentially three key steps:
* on dump, in parse_task_cgroup, we should ask the task what cgroups it
thinks it is in (unless it has the same cgroup ns id as its parent, then we
should just take the prefixes from the parent's set), and set the prefix on
the cg set
* add a new restore step, prepare_cgroup_namespace(), which happens in
prepare_task_cgroup() that does an unshare() if necessary
* when restoring, in move_in_cgroup, if we're going to restore via usernsd,
leave the full path. if not, use (cgset->path + len(cgset->cgns_prefix) as
the path, since we will have already moved into the cgns_prefix and unshared.
Another observation here is that we can support nesting, since these are
restored heirarchically by nature.
v2: * store cgns prefix length instead of full prefix in images
* set has_cgroup_ns_id conditionally
* drop unused argument to move_in_cgroup
* add extra comments about what is happening when unsharing() on
restore
* add extra comments about what is happening when computing the actual
cgns prefix
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-21 12:28:50 -07:00
|
|
|
required string name = 1;
|
|
|
|
required string path = 2;
|
|
|
|
optional uint32 cgns_prefix = 3;
|
2014-05-08 16:33:59 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
message cg_set_entry {
|
|
|
|
required uint32 id = 1;
|
2014-07-03 17:03:00 +04:00
|
|
|
repeated cg_member_entry ctls = 2;
|
2014-05-08 16:33:59 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
message cgroup_entry {
|
2014-07-10 17:00:28 +04:00
|
|
|
repeated cg_set_entry sets = 1;
|
|
|
|
repeated cg_controller_entry controllers = 2;
|
2014-05-08 16:33:59 +04:00
|
|
|
}
|