diff --git a/cr-show.c b/cr-show.c index 191cc6381..1d762c409 100644 --- a/cr-show.c +++ b/cr-show.c @@ -296,6 +296,7 @@ static struct show_image_info show_infos[] = { SHOW_VERT(FS), SHOW_VERT(GHOST_FILE), SHOW_VERT(MM), + SHOW_VERT(CGROUP), SHOW_PLAINS(REG_FILE), SHOW_PLAINS(NS_FILE), diff --git a/image-desc.c b/image-desc.c index 5a48d4be2..8145f15c1 100644 --- a/image-desc.c +++ b/image-desc.c @@ -76,6 +76,7 @@ struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX] = { FD_ENTRY(SIGNAL, "signal-s-%d"), FD_ENTRY(PSIGNAL, "signal-p-%d"), FD_ENTRY(TUNFILE, "tunfile"), + FD_ENTRY(CGROUP, "cgroup"), [CR_FD_STATS] = { .fmt = "stats-%s", diff --git a/include/image-desc.h b/include/image-desc.h index b92394f48..76644c8a6 100644 --- a/include/image-desc.h +++ b/include/image-desc.h @@ -74,6 +74,7 @@ enum { CR_FD_FANOTIFY_FILE, CR_FD_FANOTIFY_MARK, CR_FD_TUNFILE, + CR_FD_CGROUP, _CR_FD_GLOB_TO, CR_FD_TMPFS_IMG, diff --git a/include/magic.h b/include/magic.h index 6b111f5ea..09fa85da2 100644 --- a/include/magic.h +++ b/include/magic.h @@ -72,6 +72,7 @@ #define NETLINK_SK_MAGIC 0x58005614 /* Perm */ #define NS_FILES_MAGIC 0x61394011 /* Nyandoma */ #define TUNFILE_MAGIC 0x57143751 /* Kalyazin */ +#define CGROUP_MAGIC 0x59383330 /* Tikhvin */ #define IFADDR_MAGIC RAW_IMAGE_MAGIC #define ROUTE_MAGIC RAW_IMAGE_MAGIC diff --git a/include/protobuf-desc.h b/include/protobuf-desc.h index 4ad0aa507..42f837df8 100644 --- a/include/protobuf-desc.h +++ b/include/protobuf-desc.h @@ -50,6 +50,7 @@ enum { PB_SIGINFO, PB_TUNFILE, PB_IRMAP_CACHE, + PB_CGROUP, /* PB_AUTOGEN_STOP */ diff --git a/protobuf-desc.c b/protobuf-desc.c index a86ec388e..86c3acbe8 100644 --- a/protobuf-desc.c +++ b/protobuf-desc.c @@ -57,6 +57,7 @@ #include "protobuf/sk-netlink.pb-c.h" #include "protobuf/vma.pb-c.h" #include "protobuf/tun.pb-c.h" +#include "protobuf/cgroup.pb-c.h" struct cr_pb_message_desc cr_pb_descs[PB_MAX]; diff --git a/protobuf/Makefile b/protobuf/Makefile index db42368f0..e23d9c99a 100644 --- a/protobuf/Makefile +++ b/protobuf/Makefile @@ -59,6 +59,7 @@ proto-obj-y += pagemap.o proto-obj-y += siginfo.o proto-obj-y += rpc.o proto-obj-y += ext-file.o +proto-obj-y += cgroup.o proto := $(proto-obj-y:.o=) proto-c := $(proto-obj-y:.o=.pb-c.c) diff --git a/protobuf/cgroup.proto b/protobuf/cgroup.proto new file mode 100644 index 000000000..a497c702a --- /dev/null +++ b/protobuf/cgroup.proto @@ -0,0 +1,13 @@ +message controller_entry { + required string name = 1; + required string path = 2; +} + +message cg_set_entry { + required uint32 id = 1; + repeated controller_entry ctls = 2; +} + +message cgroup_entry { + repeated cg_set_entry sets = 1; +} diff --git a/protobuf/core.proto b/protobuf/core.proto index fea76218b..21218ec54 100644 --- a/protobuf/core.proto +++ b/protobuf/core.proto @@ -17,6 +17,8 @@ message task_core_entry { optional task_timers_entry timers = 7; optional task_rlimits_entry rlimits = 8; + + optional uint32 cg_set = 9; } message task_kobj_ids_entry { diff --git a/protobuf/inventory.proto b/protobuf/inventory.proto index 1a329e61d..97f572f22 100644 --- a/protobuf/inventory.proto +++ b/protobuf/inventory.proto @@ -5,4 +5,5 @@ message inventory_entry { optional bool fdinfo_per_id = 2; optional task_kobj_ids_entry root_ids = 3; optional bool ns_per_id = 4; + optional uint32 root_cg_set = 5; }