Commit 72bf807c authored by Pavel Emelyanov's avatar Pavel Emelyanov

rpc: Report PID of restore task on setup-namespaces script

This is the first time restorer gets info back from CRIU
service. At that time it makes perfect sense to report
what PID we're working with.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 2c90bb0c
...@@ -125,6 +125,16 @@ int send_criu_rpc_script(char *script, int fd) ...@@ -125,6 +125,16 @@ int send_criu_rpc_script(char *script, int fd)
msg.notify = &cn; msg.notify = &cn;
cn.script = script; cn.script = script;
if (!strcmp(script, "setup-namespaces")) {
/*
* FIXME pid is required only once on
* restore. Need some more sane way of
* checking this.
*/
cn.has_pid = true;
cn.pid = root_item->pid.real;
}
ret = send_criu_msg(fd, &msg); ret = send_criu_msg(fd, &msg);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -39,6 +39,7 @@ message criu_restore_resp { ...@@ -39,6 +39,7 @@ message criu_restore_resp {
message criu_notify { message criu_notify {
optional string script = 1; optional string script = 1;
optional int32 pid = 2;
} }
enum criu_req_type { enum criu_req_type {
......
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