mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-25 02:58:54 +00:00
dump: Don't kill tasks after failed dump
This is not very good practice :) Just leave them in the state they've been to before dumping. Plz note, that tasks segfault for some reason after unseizeing, but this is another story. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
13ee53a098
commit
1e9ccd2bbd
2 changed files with 8 additions and 8 deletions
14
cr-dump.c
14
cr-dump.c
|
|
@ -1076,16 +1076,13 @@ static void unseize_task_and_threads(const struct pstree_item *item, int st)
|
|||
unseize_task(item->threads[i], st); /* item->pid will be here */
|
||||
}
|
||||
|
||||
static void pstree_switch_state(const struct list_head *list,
|
||||
const struct cr_options *opts)
|
||||
static void pstree_switch_state(const struct list_head *list, int st)
|
||||
{
|
||||
struct pstree_item *item;
|
||||
|
||||
list_for_each_entry(item, list, list) {
|
||||
unseize_task_and_threads(item, opts->final_state);
|
||||
if (opts->leader_only)
|
||||
break;
|
||||
}
|
||||
pr_info("Unfreezing tasks into %d\n", st);
|
||||
list_for_each_entry(item, list, list)
|
||||
unseize_task_and_threads(item, st);
|
||||
}
|
||||
|
||||
static int seize_threads(const struct pstree_item *item)
|
||||
|
|
@ -1691,7 +1688,8 @@ err:
|
|||
xfree(shmems);
|
||||
xfree(pipes);
|
||||
close_cr_fdset(&glob_fdset);
|
||||
pstree_switch_state(&pstree_list, opts);
|
||||
pstree_switch_state(&pstree_list,
|
||||
ret ? TASK_ALIVE : opts->final_state);
|
||||
free_pstree(&pstree_list);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
2
ptrace.c
2
ptrace.c
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
int unseize_task(pid_t pid, int st)
|
||||
{
|
||||
pr_debug("\tUnseizeing %d into %d\n", pid, st);
|
||||
|
||||
if (st == TASK_DEAD)
|
||||
kill(pid, SIGKILL);
|
||||
else if (st == TASK_STOPPED)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue