[CRIU] [PATCH 6/8] restore: Run setup-ns scripts before restoring them

Pavel Emelyanov xemul at parallels.com
Thu Dec 26 05:00:38 PST 2013


We should call external scripts when namespaces are created,
but before we try to fill them with data from images.

This is done so e.g. to make it possible to push external net
links to netns.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 cr-restore.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 274d760..8dd19e3 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -1263,6 +1263,9 @@ static int restore_task_with_children(void *_arg)
 
 	/* Restore root task */
 	if (current->parent == NULL) {
+		if (restore_finish_stage(CR_STATE_RESTORE_NS) < 0)
+			exit(1);
+
 		if (collect_mount_info(getpid()))
 			exit(1);
 
@@ -1277,9 +1280,6 @@ static int restore_task_with_children(void *_arg)
 		if (mount_proc())
 			exit(1);
 
-		if (restore_finish_stage(CR_STATE_RESTORE_NS) < 0)
-			exit(1);
-
 		if (root_prepare_shared())
 			exit(1);
 	}
-- 
1.8.3.1


More information about the CRIU mailing list