[CRIU] [PATCH 05/10] restore: Rename CR_STATE_RESTORE_NS -> _ROOT_TASK
Pavel Emelyanov
xemul at virtuozzo.com
Fri Apr 28 05:28:25 PDT 2017
The stage name is what tasks do, not what criu waits for.
When the first stage is started we want the root task to
come up, rather than namespaces to get restored.
Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
criu/cr-restore.c | 6 +++---
criu/include/restorer.h | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 4e2609a..63c8080 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -127,7 +127,7 @@ static inline int stage_participants(int next_stage)
switch (next_stage) {
case CR_STATE_FAIL:
return 0;
- case CR_STATE_RESTORE_NS:
+ case CR_STATE_ROOT_TASK:
case CR_STATE_POST_RESTORE_NS:
case CR_STATE_RESTORE_SHARED:
return 1;
@@ -1509,7 +1509,7 @@ static int restore_task_with_children(void *_arg)
/* Wait prepare_userns */
if (current->parent == NULL &&
- restore_finish_stage(task_entries, CR_STATE_RESTORE_NS) < 0)
+ restore_finish_stage(task_entries, CR_STATE_ROOT_TASK) < 0)
goto err;
/*
@@ -1892,7 +1892,7 @@ static int restore_root_task(struct pstree_item *init)
if (prepare_namespace_before_tasks())
return -1;
- __restore_switch_stage_nw(CR_STATE_RESTORE_NS);
+ __restore_switch_stage_nw(CR_STATE_ROOT_TASK);
ret = fork_with_pid(init);
if (ret < 0)
diff --git a/criu/include/restorer.h b/criu/include/restorer.h
index 9a392a8..f74821f 100644
--- a/criu/include/restorer.h
+++ b/criu/include/restorer.h
@@ -205,7 +205,7 @@ static inline unsigned long restorer_stack(struct restore_mem_zone *mz)
enum {
CR_STATE_FAIL = -1,
- CR_STATE_RESTORE_NS = 0, /* is used for executing "setup-namespace" scripts */
+ CR_STATE_ROOT_TASK = 0, /* is used for executing "setup-namespace" scripts */
/*
* Need to wait a mount namespace which
* will be used to clean up remap files.
--
2.1.4
More information about the CRIU
mailing list