2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

Allow dumps of stopped multithreaded processes

CRIU can handle stopped multithreaded processes when all threads
are stopped. Refine the check to allow this case.

Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Christopher Covington
2014-04-09 11:13:11 -04:00
committed by Pavel Emelyanov
parent 2713b6a39c
commit c1cd6b5e5f

View File

@@ -833,7 +833,7 @@ static pid_t item_ppid(const struct pstree_item *item)
static int seize_threads(struct pstree_item *item, static int seize_threads(struct pstree_item *item,
struct pid *threads, int nr_threads) struct pid *threads, int nr_threads)
{ {
int i = 0, ret, j, nr_inprogress; int i = 0, ret, j, nr_inprogress, nr_stopped = 0;
if ((item->state == TASK_DEAD) && (nr_threads > 1)) { if ((item->state == TASK_DEAD) && (nr_threads > 1)) {
pr_err("Zombies with threads are not supported\n"); pr_err("Zombies with threads are not supported\n");
@@ -889,11 +889,15 @@ static int seize_threads(struct pstree_item *item,
} }
if (ret == TASK_STOPPED) { if (ret == TASK_STOPPED) {
pr_err("Stopped threads not supported\n"); nr_stopped++;
goto err;
} }
} }
if (nr_stopped && nr_stopped != nr_inprogress) {
pr_err("Individually stopped threads not supported\n");
goto err;
}
return nr_inprogress; return nr_inprogress;
err: err:
return -1; return -1;