2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

dump: Move core dumping behind parasite code run

This is required for patch #4

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
Pavel Emelyanov
2012-02-12 00:28:36 +04:00
committed by Cyrill Gorcunov
parent 028d5df3b0
commit 583a7fe8c3

View File

@@ -664,7 +664,7 @@ static int dump_task_core(struct core_entry *core, struct cr_fdset *fdset)
return ret;
}
static int dump_task_core_seized(pid_t pid, int pid_dir, struct proc_pid_stat *stat,
static int dump_task_core_all(pid_t pid, int pid_dir, struct proc_pid_stat *stat,
struct cr_fdset *cr_fdset)
{
struct core_entry *core = xzalloc(sizeof(*core));
@@ -1200,12 +1200,6 @@ static int dump_one_task(struct pstree_item *item, struct cr_fdset *cr_fdset)
goto err;
}
ret = dump_task_core_seized(pid, pid_dir, &pps_buf, cr_fdset);
if (ret) {
pr_err("Dump core (pid: %d) failed with %d\n", pid, ret);
goto err;
}
parasite_ctl = parasite_infect_seized(pid, &vma_area_list);
if (!parasite_ctl) {
pr_err("Can't infect (pid: %d) with parasite\n", pid);
@@ -1260,6 +1254,12 @@ static int dump_one_task(struct pstree_item *item, struct cr_fdset *cr_fdset)
goto err;
}
ret = dump_task_core_all(pid, pid_dir, &pps_buf, cr_fdset);
if (ret) {
pr_err("Dump core (pid: %d) failed with %d\n", pid, ret);
goto err;
}
ret = finalize_core(pid, &vma_area_list, cr_fdset);
if (ret) {
pr_err("Finalizing core (pid: %d) failed with %d\n", pid, ret);