2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00

17 Commits

Author SHA1 Message Date
Pavel Emelyanov
d6514dae45 pb: Introduce show_plain routine
This one walks the 'plain' image file, i.e. the one with straignt <magi>[<size><entry>]*
format, and prints each message. Saves lots of lines of code.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-18 19:09:51 +04:00
Stanislav Kinsbursky
656a463769 show: Convert simple array showing fns to use pb_show_msg
[merges some Stas' patches]

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 08:26:25 +04:00
Pavel Emelyanov
786012e891 mnt: Fix mountinfo collecting issues
1. Mountinfo should be collected after we have forked into new namespace (strictly
   speaking this is so)
2. When restoring a mnt ns we can reuse the collected mntinfos rather than reading
   them again.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-15 08:43:37 +04:00
Cyrill Gorcunov
ca08ad53a6 protobuf: Convert mnt_entry to PB engine
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-17 14:23:37 +04:00
Pavel Emelyanov
fe41f84b42 mount: Mounting code core
Only support virtual filesystems mount. No bindmounts or disk fs
due to non trivial resolving of devices names and binmount sources.
Will be implemented later.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 20:57:39 +04:00
Pavel Emelyanov
1adb7d2416 mount: Umount a mountpoint when iterating
The tree should already be sorted, thus the call for umount shouldn't fail.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-06-27 20:57:38 +04:00
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