Commit b58eb26f authored by Ruslan Kuprieiev's avatar Ruslan Kuprieiev Committed by Pavel Emelyanov

service: add cr_errno to criu_resp and send cr_errno in it, v2

v2, set cr_errno only if we have one that is != 0
Signed-off-by: 's avatarRuslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 2d91ff5f
......@@ -88,7 +88,10 @@ static void send_criu_err(int sk, char *msg)
resp.type = CRIU_REQ_TYPE__EMPTY;
resp.success = false;
/* XXX -- add optional error code to CriuResp */
if (get_cr_errno()) {
resp.has_cr_errno = true;
resp.cr_errno = get_cr_errno();
}
send_criu_msg(sk, &resp);
}
......@@ -100,6 +103,10 @@ int send_criu_dump_resp(int socket_fd, bool success, bool restored)
msg.type = CRIU_REQ_TYPE__DUMP;
msg.success = success;
if (get_cr_errno()) {
msg.has_cr_errno = true;
msg.cr_errno = get_cr_errno();
}
msg.dump = &resp;
resp.has_restored = true;
......@@ -114,6 +121,10 @@ static int send_criu_pre_dump_resp(int socket_fd, bool success)
msg.type = CRIU_REQ_TYPE__PRE_DUMP;
msg.success = success;
if (get_cr_errno()) {
msg.has_cr_errno = true;
msg.cr_errno = get_cr_errno();
}
return send_criu_msg(socket_fd, &msg);
}
......@@ -125,6 +136,10 @@ int send_criu_restore_resp(int socket_fd, bool success, int pid)
msg.type = CRIU_REQ_TYPE__RESTORE;
msg.success = success;
if (get_cr_errno()) {
msg.has_cr_errno = true;
msg.cr_errno = get_cr_errno();
}
msg.restore = &resp;
resp.pid = pid;
......
......@@ -116,4 +116,6 @@ message criu_resp {
optional criu_restore_resp restore = 4;
optional criu_notify notify = 5;
optional criu_page_server_info ps = 6;
optional int32 cr_errno = 7;
}
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