[CRIU] [PATCH 5/8] rpc: Add more stuff to RPC messages
Pavel Emelyanov
xemul at parallels.com
Tue Jan 28 10:36:36 PST 2014
This includes pre-dump and page-server actions and
arguments for memory tracking and page-server.
Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
cr-service.c | 15 +++++++++++++++
protobuf/rpc.proto | 15 +++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/cr-service.c b/cr-service.c
index 051076d..6c876ed 100644
--- a/cr-service.c
+++ b/cr-service.c
@@ -138,6 +138,9 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
/* going to dir, where to place/get images*/
sprintf(images_dir_path, "/proc/%d/fd/%d", ids.pid, req->images_dir_fd);
+ if (req->parent_img)
+ opts.img_parent = req->parent_img;
+
if (chdir(images_dir_path)) {
pr_perror("Can't chdir to images directory");
return -1;
@@ -170,6 +173,9 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
if (req->has_ext_unix_sk)
opts.ext_unix_sk = req->ext_unix_sk;
+ if (req->root)
+ opts.root = req->root;
+
if (req->has_tcp_established)
opts.tcp_established_ok = req->tcp_established;
@@ -182,6 +188,15 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
if (req->has_file_locks)
opts.handle_file_locks = req->file_locks;
+ if (req->has_track_mem)
+ opts.track_mem = req->track_mem;
+
+ if (req->ps) {
+ opts.use_page_server = true;
+ opts.addr = req->ps->address;
+ opts.ps_port = htons((short)req->ps->port);
+ }
+
return 0;
}
diff --git a/protobuf/rpc.proto b/protobuf/rpc.proto
index 7bea573..a6d2cb3 100644
--- a/protobuf/rpc.proto
+++ b/protobuf/rpc.proto
@@ -1,3 +1,9 @@
+message criu_page_server_info {
+ optional string address = 1;
+ optional int32 port = 2;
+ optional int32 pid = 3;
+}
+
message criu_opts {
required int32 images_dir_fd = 1;
optional int32 pid = 2; //if not set on dump, will dump requesting process
@@ -10,6 +16,12 @@ message criu_opts {
optional bool file_locks = 8;
optional int32 log_level = 9 [default = 2];
optional string log_file = 10;
+
+ optional criu_page_server_info ps = 11;
+
+ optional string root = 13;
+ optional string parent_img = 14;
+ optional bool track_mem = 15;
}
message criu_dump_resp {
@@ -25,6 +37,8 @@ enum criu_req_type {
DUMP = 1;
RESTORE = 2;
CHECK = 3;
+ PRE_DUMP = 4;
+ PAGE_SERVER = 5;
}
/*
@@ -49,4 +63,5 @@ message criu_resp {
optional criu_dump_resp dump = 3;
optional criu_restore_resp restore = 4;
+ optional criu_page_server_info ps = 6;
}
--
1.8.4.2
More information about the CRIU
mailing list