Commit 1e9ccd2b authored by Pavel Emelyanov's avatar Pavel Emelyanov

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: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 13ee53a0
......@@ -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;
......
......@@ -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)
......
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