2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00

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: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov 2014-05-08 16:33:59 +04:00
parent b48e4cbfb8
commit 06f7243380
10 changed files with 23 additions and 0 deletions

View File

@ -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),

View File

@ -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",

View File

@ -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,

View File

@ -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

View File

@ -50,6 +50,7 @@ enum {
PB_SIGINFO,
PB_TUNFILE,
PB_IRMAP_CACHE,
PB_CGROUP,
/* PB_AUTOGEN_STOP */

View File

@ -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];

View File

@ -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)

13
protobuf/cgroup.proto Normal file
View File

@ -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;
}

View File

@ -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 {

View File

@ -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;
}