2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 05:18:00 +00:00

111 Commits

Author SHA1 Message Date
Pavel Emelyanov
f0c68e7361 mount: Tree walking functions
Two walkers -- in forward and reverse directions -- are required
for correct (u)mounting of subtrees. Implement them using a helper
macro which walks the tree in both directions.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 20:57:37 +04:00
Pavel Emelyanov
95964f1b13 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>
2012-06-27 20:57:36 +04:00
Pavel Emelyanov
fc416d8694 mount: Build mount points tree out of a plain list
Build a tree of mountpoins that can be (u)mounted in a straight
(forward or backward) order without EBUSY errors.

The tree is built in two steps -- first create hierarchy based
on mount iDs. Next -- resort siblings in the path depth order.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 20:57:34 +04:00
Pavel Emelyanov
8f288a0c51 mount: Dump fstype
Encode it in u32 since we have to check filesystem name anyway
(not everyone ie easily migratable).

Dump _any_ root fs as we need the root entry on restore though
do not mount it then -- it should be provided before crtools
restore start.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 20:57:32 +04:00
Pavel Emelyanov
54f42f2bfe mount: Basic mount points dumping
Dumping is straightforward -- just copy all the mount_info
fields into the new image file. Dump everything but fstype,
this one will come in a separate patch.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 20:57:31 +04:00
Pavel Emelyanov
e0cb53a19f mount: Rename struct proc_mountinfo into mount_info
This structure will be used on restore and will be created
from the image, thus the name proc_ is not suitable.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 20:57:30 +04:00
Pavel Emelyanov
5e593e9b57 proc: Sanitize mountinfo parsing
Make the proc_mountinfo obtaned after parse form a single linked list.
That's much easier to handle and doesn't have an artificial limitation
of 64 items...

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-13 08:34:16 +04:00
Pavel Emelyanov
79da538469 mount: Rename proc_mountinfo mnt_root to mountpoint
What is stored there is the path to mountpoint. The root
is the field previously named "parent root".

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-12 03:40:08 +04:00
Pavel Emelyanov
db297a0f97 mnt: Preparations for mountpoints dumping
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-12 03:30:10 +04:00
Cyrill Gorcunov
bff52ba952 inotify: Add checkpoint/restore v2
v2:
 - open_mount is cleaned up
 - byte-stream hex conversion remains untouched since
   strtol is flipping numbers to LE manner

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-04 14:00:45 +04:00
Cyrill Gorcunov
ed59bf001b Add mount.c file for mount helpers functions
At moment only open_mnt_root is there, which is
needed for inotify restore.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-04 14:00:36 +04:00