mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-04 00:05:26 +00:00
v2 rpc: change some "required" fields to "optional"
The most of fields are to be changed to "optional", because they are optional in fact. Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
551cd03290
commit
98b5541492
21
cr-service.c
21
cr-service.c
@@ -86,9 +86,6 @@ static int setup_dump_from_req(CriuDumpReq *req)
|
||||
cr_service_client->pid = ids.pid;
|
||||
cr_service_client->uid = ids.uid;
|
||||
|
||||
if (req->pid == 0)
|
||||
req->pid = ids.pid;
|
||||
|
||||
if (fstat(cr_service_client->sk_fd, &st)) {
|
||||
pr_perror("Can't get socket stat");
|
||||
return -1;
|
||||
@@ -120,13 +117,27 @@ static int setup_dump_from_req(CriuDumpReq *req)
|
||||
}
|
||||
|
||||
/* checking dump flags from client */
|
||||
if (req->leave_running)
|
||||
if (req->has_leave_running && req->leave_running)
|
||||
opts.final_state = TASK_ALIVE;
|
||||
|
||||
if (!req->has_pid) {
|
||||
req->has_pid = true;
|
||||
req->pid = ids.pid;
|
||||
}
|
||||
|
||||
if (req->has_ext_unix_sk)
|
||||
opts.ext_unix_sk = req->ext_unix_sk;
|
||||
|
||||
if (req->has_tcp_established)
|
||||
opts.tcp_established_ok = req->tcp_established;
|
||||
|
||||
if (req->has_evasive_devices)
|
||||
opts.evasive_devices = req->evasive_devices;
|
||||
|
||||
if (req->has_shell_job)
|
||||
opts.shell_job = req->shell_job;
|
||||
|
||||
if (req->has_file_locks)
|
||||
opts.handle_file_locks = req->file_locks;
|
||||
|
||||
return 0;
|
||||
@@ -149,7 +160,7 @@ static int dump_using_req(CriuDumpReq *req)
|
||||
resp.success = true;
|
||||
|
||||
exit:
|
||||
if (req->leave_running) {
|
||||
if (req->has_leave_running && req->leave_running) {
|
||||
if (send_criu_dump_resp(cr_service_client->sk_fd,
|
||||
&resp) == -1) {
|
||||
pr_perror("Can't send response");
|
||||
|
@@ -1,18 +1,18 @@
|
||||
message criu_dump_req {
|
||||
required int32 pid = 1; //if not set, will dump requesting process
|
||||
required bool leave_running = 2;
|
||||
required bool ext_unix_sk = 3;
|
||||
required bool tcp_established = 4;
|
||||
required bool evasive_devices = 5;
|
||||
required bool shell_job = 6;
|
||||
required bool file_locks = 7;
|
||||
optional int32 pid = 1; //if not set, will dump requesting process
|
||||
optional bool leave_running = 2;
|
||||
optional bool ext_unix_sk = 3;
|
||||
optional bool tcp_established = 4;
|
||||
optional bool evasive_devices = 5;
|
||||
optional bool shell_job = 6;
|
||||
optional bool file_locks = 7;
|
||||
required int32 images_dir_fd = 8;
|
||||
required int32 log_level = 9 [default = 2];
|
||||
optional int32 log_level = 9 [default = 2];
|
||||
}
|
||||
|
||||
message criu_dump_resp {
|
||||
required bool success = 1;
|
||||
required bool restored = 2;
|
||||
optional bool restored = 2;
|
||||
}
|
||||
|
||||
message criu_msg {
|
||||
|
Reference in New Issue
Block a user