Commit 06f72433 authored by Pavel Emelyanov's avatar Pavel Emelyanov

image: Add bits and pieces for cgroups image

The exact structure of the image will be revealed in the
next patch(es). What is important here, is that cgroup
image is somewhat new.

It will likely contain arrays of objects of different types,
so I introduce the "header" object, that will link these
arrays using pb repeated fields. This will help us to avoid
many image files for different cgroup objects and will make
the amount of write()-s required be 1.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent b48e4cbf
...@@ -296,6 +296,7 @@ static struct show_image_info show_infos[] = { ...@@ -296,6 +296,7 @@ static struct show_image_info show_infos[] = {
SHOW_VERT(FS), SHOW_VERT(FS),
SHOW_VERT(GHOST_FILE), SHOW_VERT(GHOST_FILE),
SHOW_VERT(MM), SHOW_VERT(MM),
SHOW_VERT(CGROUP),
SHOW_PLAINS(REG_FILE), SHOW_PLAINS(REG_FILE),
SHOW_PLAINS(NS_FILE), SHOW_PLAINS(NS_FILE),
......
...@@ -76,6 +76,7 @@ struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX] = { ...@@ -76,6 +76,7 @@ struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX] = {
FD_ENTRY(SIGNAL, "signal-s-%d"), FD_ENTRY(SIGNAL, "signal-s-%d"),
FD_ENTRY(PSIGNAL, "signal-p-%d"), FD_ENTRY(PSIGNAL, "signal-p-%d"),
FD_ENTRY(TUNFILE, "tunfile"), FD_ENTRY(TUNFILE, "tunfile"),
FD_ENTRY(CGROUP, "cgroup"),
[CR_FD_STATS] = { [CR_FD_STATS] = {
.fmt = "stats-%s", .fmt = "stats-%s",
......
...@@ -74,6 +74,7 @@ enum { ...@@ -74,6 +74,7 @@ enum {
CR_FD_FANOTIFY_FILE, CR_FD_FANOTIFY_FILE,
CR_FD_FANOTIFY_MARK, CR_FD_FANOTIFY_MARK,
CR_FD_TUNFILE, CR_FD_TUNFILE,
CR_FD_CGROUP,
_CR_FD_GLOB_TO, _CR_FD_GLOB_TO,
CR_FD_TMPFS_IMG, CR_FD_TMPFS_IMG,
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
#define NETLINK_SK_MAGIC 0x58005614 /* Perm */ #define NETLINK_SK_MAGIC 0x58005614 /* Perm */
#define NS_FILES_MAGIC 0x61394011 /* Nyandoma */ #define NS_FILES_MAGIC 0x61394011 /* Nyandoma */
#define TUNFILE_MAGIC 0x57143751 /* Kalyazin */ #define TUNFILE_MAGIC 0x57143751 /* Kalyazin */
#define CGROUP_MAGIC 0x59383330 /* Tikhvin */
#define IFADDR_MAGIC RAW_IMAGE_MAGIC #define IFADDR_MAGIC RAW_IMAGE_MAGIC
#define ROUTE_MAGIC RAW_IMAGE_MAGIC #define ROUTE_MAGIC RAW_IMAGE_MAGIC
......
...@@ -50,6 +50,7 @@ enum { ...@@ -50,6 +50,7 @@ enum {
PB_SIGINFO, PB_SIGINFO,
PB_TUNFILE, PB_TUNFILE,
PB_IRMAP_CACHE, PB_IRMAP_CACHE,
PB_CGROUP,
/* PB_AUTOGEN_STOP */ /* PB_AUTOGEN_STOP */
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#include "protobuf/sk-netlink.pb-c.h" #include "protobuf/sk-netlink.pb-c.h"
#include "protobuf/vma.pb-c.h" #include "protobuf/vma.pb-c.h"
#include "protobuf/tun.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]; struct cr_pb_message_desc cr_pb_descs[PB_MAX];
......
...@@ -59,6 +59,7 @@ proto-obj-y += pagemap.o ...@@ -59,6 +59,7 @@ proto-obj-y += pagemap.o
proto-obj-y += siginfo.o proto-obj-y += siginfo.o
proto-obj-y += rpc.o proto-obj-y += rpc.o
proto-obj-y += ext-file.o proto-obj-y += ext-file.o
proto-obj-y += cgroup.o
proto := $(proto-obj-y:.o=) proto := $(proto-obj-y:.o=)
proto-c := $(proto-obj-y:.o=.pb-c.c) proto-c := $(proto-obj-y:.o=.pb-c.c)
......
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;
}
...@@ -17,6 +17,8 @@ message task_core_entry { ...@@ -17,6 +17,8 @@ message task_core_entry {
optional task_timers_entry timers = 7; optional task_timers_entry timers = 7;
optional task_rlimits_entry rlimits = 8; optional task_rlimits_entry rlimits = 8;
optional uint32 cg_set = 9;
} }
message task_kobj_ids_entry { message task_kobj_ids_entry {
......
...@@ -5,4 +5,5 @@ message inventory_entry { ...@@ -5,4 +5,5 @@ message inventory_entry {
optional bool fdinfo_per_id = 2; optional bool fdinfo_per_id = 2;
optional task_kobj_ids_entry root_ids = 3; optional task_kobj_ids_entry root_ids = 3;
optional bool ns_per_id = 4; optional bool ns_per_id = 4;
optional uint32 root_cg_set = 5;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment