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: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov 2014-02-11 09:53:32 +04:00
parent 2c90bb0ce5
commit 72bf807cfb
2 changed files with 11 additions and 0 deletions

View file

@ -125,6 +125,16 @@ int send_criu_rpc_script(char *script, int fd)
msg.notify = &cn;
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);
if (ret < 0)
return ret;

View file

@ -39,6 +39,7 @@ message criu_restore_resp {
message criu_notify {
optional string script = 1;
optional int32 pid = 2;
}
enum criu_req_type {