[CRIU] [PATCH 6/6] dump: restore state correctly

Andrey Vagin avagin at openvz.org
Thu Dec 19 04:59:46 PST 2013


Currently all task are restored as alive, but stopped tasks
must be restored as stopped.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-dump.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/cr-dump.c b/cr-dump.c
index 13a7b54..7da3201 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -790,7 +790,13 @@ static void unseize_task_and_threads(const struct pstree_item *item, int st)
 {
 	int i;
 
-	unseize_task(item->pid.real, st); /* item->pid will be here */
+	if (item->state == TASK_DEAD)
+		return;
+
+	if (st == TASK_ALIVE)
+		unseize_task(item->pid.real, item->state);
+	else
+		unseize_task(item->pid.real, st); /* item->pid will be here */
 
 	for (i = 1; i < item->nr_threads; i++)
 		ptrace(PTRACE_DETACH, item->threads[i].real, NULL, NULL);
-- 
1.8.3.1



More information about the CRIU mailing list