mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 14:55:39 +00:00
v2 service: don't send dump response in case of self-dump without leave_running
Currently we have a bug: if no leave_running is set in request, service won't send dump response. We must not send response only if it was a self-dump request and no leave_running option was set. 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
7be5a1b95d
commit
2e8ff1a22a
@@ -166,6 +166,7 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
|
|||||||
static int dump_using_req(int sk, CriuOpts *req)
|
static int dump_using_req(int sk, CriuOpts *req)
|
||||||
{
|
{
|
||||||
bool success = false;
|
bool success = false;
|
||||||
|
bool self_dump = !req->pid;
|
||||||
|
|
||||||
if (setup_opts_from_req(sk, req) == -1) {
|
if (setup_opts_from_req(sk, req) == -1) {
|
||||||
pr_perror("Arguments treating fail");
|
pr_perror("Arguments treating fail");
|
||||||
@@ -175,7 +176,7 @@ static int dump_using_req(int sk, CriuOpts *req)
|
|||||||
if (cr_dump_tasks(req->pid) == -1)
|
if (cr_dump_tasks(req->pid) == -1)
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
||||||
if (req->has_leave_running && req->leave_running) {
|
if (req->leave_running || !self_dump) {
|
||||||
success = true;
|
success = true;
|
||||||
exit:
|
exit:
|
||||||
if (send_criu_dump_resp(sk, success, false) == -1) {
|
if (send_criu_dump_resp(sk, success, false) == -1) {
|
||||||
|
Reference in New Issue
Block a user