Commit e46a9f6b authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

parasite: send PARASITE_CMD_FINI before resuming the target process

The control socket has enough buffer for one command and the target
process will not wait a new command, so we will avoid extra context
switches.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 8b9e18f0
...@@ -863,17 +863,17 @@ static int parasite_fini_seized(struct parasite_ctl *ctl) ...@@ -863,17 +863,17 @@ static int parasite_fini_seized(struct parasite_ctl *ctl)
return -1; return -1;
} }
ret = __parasite_execute_daemon(PARASITE_CMD_FINI, ctl);
close_safe(&ctl->tsock);
if (ret)
return -1;
ret = ptrace(PTRACE_SYSCALL, pid, NULL, NULL); ret = ptrace(PTRACE_SYSCALL, pid, NULL, NULL);
if (ret) { if (ret) {
pr_perror("ptrace"); pr_perror("ptrace");
return -1; return -1;
} }
ret = __parasite_execute_daemon(PARASITE_CMD_FINI, ctl);
close_safe(&ctl->tsock);
if (ret)
return -1;
if (parasite_stop_on_syscall(1, __NR_rt_sigreturn)) if (parasite_stop_on_syscall(1, __NR_rt_sigreturn))
return -1; return -1;
......
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