[CRIU] [PATCH 14/15] restore: Move other task-args preparations from sigreturn_restore

Pavel Emelyanov xemul at virtuozzo.com
Tue May 24 04:37:01 PDT 2016


Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/cr-restore.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 948b4a0..cfa1c4e 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -477,6 +477,9 @@ static int prepare_proc_misc(pid_t pid, TaskCoreEntry *tc)
 	return 0;
 }
 
+static int prepare_itimers(int pid, struct task_restore_args *args, CoreEntry *core);
+static int prepare_mm(pid_t pid, struct task_restore_args *args);
+
 static int restore_one_alive_task(int pid, CoreEntry *core)
 {
 	unsigned args_len;
@@ -551,6 +554,12 @@ static int restore_one_alive_task(int pid, CoreEntry *core)
 	if (seccomp_filters_get_rst_pos(core, ta) < 0)
 		return -1;
 
+	if (prepare_itimers(pid, ta, core) < 0)
+		return -1;
+
+	if (prepare_mm(pid, ta))
+		return -1;
+
 	return sigreturn_restore(pid, ta_cp, core);
 }
 
@@ -2061,7 +2070,7 @@ out:
 	return ret;
 }
 
-static int prepare_itimers(int pid, CoreEntry *core, struct task_restore_args *args)
+static int prepare_itimers(int pid, struct task_restore_args *args, CoreEntry *core)
 {
 	int ret = 0;
 	TaskTimersEntry *tte = core->tc->timers;
@@ -2973,14 +2982,6 @@ static int sigreturn_restore(pid_t pid, unsigned long ta_cp, CoreEntry *core)
 
 	new_sp = restorer_stack(task_args->t->mz);
 
-	ret = prepare_itimers(pid, core, task_args);
-	if (ret < 0)
-		goto err;
-
-	ret = prepare_mm(pid, task_args);
-	if (ret < 0)
-		goto err;
-
 	/* No longer need it */
 	core_entry__free_unpacked(core, NULL);
 	xfree(current->core);
-- 
2.5.0



More information about the CRIU mailing list