[CRIU] [PATCH 2/4] Allow dumps of stopped multithreaded processes
Christopher Covington
cov at codeaurora.org
Wed Apr 9 08:13:11 PDT 2014
CRIU can handle stopped multithreaded processes when all threads
are stopped. Refine the check to allow this case.
Signed-off-by: Christopher Covington <cov at codeaurora.org>
---
cr-dump.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/cr-dump.c b/cr-dump.c
index 9313a7c..5e3371e 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -833,7 +833,7 @@ static pid_t item_ppid(const struct pstree_item *item)
static int seize_threads(struct pstree_item *item,
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)) {
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) {
- pr_err("Stopped threads not supported\n");
- goto err;
+ nr_stopped++;
}
}
+ if (nr_stopped && nr_stopped != nr_inprogress) {
+ pr_err("Individually stopped threads not supported\n");
+ goto err;
+ }
+
return nr_inprogress;
err:
return -1;
--
Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by the Linux Foundation.
More information about the CRIU
mailing list