2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

mount: Core for creating mount namespace

Namespace restore goes in two steps -- first, clean old mountpoints
(except root) that are left after clone(CLONE_NEWNS) call. Next,
repopulate the namespace with new mountpoints (except root) read
from the image file.

This patch adds the skeleton for the above -- reading the mountpoints
from current proc and image and calling for mount/umount. The real
action will come in further patches.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2012-06-27 20:57:36 +04:00
parent 57095eb946
commit 95964f1b13
3 changed files with 137 additions and 2 deletions

View File

@@ -124,6 +124,8 @@ int prepare_namespace(int pid, unsigned long clone_flags)
ret = prepare_utsns(pid);
if (clone_flags & CLONE_NEWIPC)
ret = prepare_ipc_ns(pid);
if (clone_flags & CLONE_NEWNS)
ret = prepare_mnt_ns(pid);
return ret;
}