From eb43ea2389904447cfdfc9fd89143e06b99e378e Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Fri, 28 Apr 2017 15:28:55 +0300 Subject: [PATCH] restore: Kill CR_STATE_RESTORE_SHARED Looks like this separate stage is not needed. The scripts involved in ns restore are synchronized with existing stages like this: criu: root task: ROOT_TASK stage "setup-ns" script PREPARE_NAMESPACES prepare_namespace() "post-setup-ns" script FORKING restore_task_mnt_ns() which seems to be OK. Signed-off-by: Pavel Emelyanov Signed-off-by: Andrei Vagin --- criu/cr-restore.c | 11 ++--------- criu/include/restorer.h | 1 - 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/criu/cr-restore.c b/criu/cr-restore.c index 26376aa7b..8dee80d85 100644 --- a/criu/cr-restore.c +++ b/criu/cr-restore.c @@ -127,7 +127,6 @@ static inline int stage_participants(int next_stage) return 0; case CR_STATE_ROOT_TASK: case CR_STATE_PREPARE_NAMESPACES: - case CR_STATE_RESTORE_SHARED: return 1; case CR_STATE_FORKING: return task_entries->nr_tasks + task_entries->nr_helpers; @@ -1569,9 +1568,6 @@ static int restore_task_with_children(void *_arg) if (root_prepare_shared()) goto err; - - if (restore_finish_stage(task_entries, CR_STATE_RESTORE_SHARED) < 0) - goto err; } if (restore_task_mnt_ns(current)) @@ -1970,15 +1966,12 @@ static int restore_root_task(struct pstree_item *init) goto out_kill; } - timing_start(TIME_FORK); - ret = restore_switch_stage(CR_STATE_RESTORE_SHARED); - if (ret < 0) - goto out_kill; - ret = run_scripts(ACT_POST_SETUP_NS); if (ret) goto out_kill; + timing_start(TIME_FORK); + ret = restore_switch_stage(CR_STATE_FORKING); if (ret < 0) goto out_kill; diff --git a/criu/include/restorer.h b/criu/include/restorer.h index 4deaf78d5..4eb18d31f 100644 --- a/criu/include/restorer.h +++ b/criu/include/restorer.h @@ -207,7 +207,6 @@ enum { * will be used to clean up remap files. */ CR_STATE_PREPARE_NAMESPACES, - CR_STATE_RESTORE_SHARED, CR_STATE_FORKING, CR_STATE_RESTORE, CR_STATE_RESTORE_SIGCHLD,