Commit 3587dc1f authored by Pavel Emelyanov's avatar Pavel Emelyanov

rpc: Add more stuff to RPC messages

This includes pre-dump and page-server actions and
arguments for memory tracking and page-server.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f200b7a9
......@@ -137,6 +137,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;
......@@ -169,6 +172,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;
......@@ -181,6 +187,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;
}
......
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;
}
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