2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-03 07:45:17 +00:00

mount: save local mount point paths on restore

On restore we add a temporary root to a mount point path. It's convinient
for restoring mount namespaces, but real paths are used for restoring
link-remap files.

v2: replace the offset field on a char * field

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2014-08-05 17:20:25 +04:00
committed by Pavel Emelyanov
parent 7db1e6b9b9
commit ce5aa74d10
2 changed files with 3 additions and 0 deletions

View File

@@ -114,8 +114,10 @@ struct mount_info {
* On restore mountpoint is prepended with so called ns * On restore mountpoint is prepended with so called ns
* root path -- it's a place in fs where the namespace * root path -- it's a place in fs where the namespace
* mount tree is constructed. Check mnt_roots for details. * mount tree is constructed. Check mnt_roots for details.
* The ns_mountpoint contains path w/o this prefix.
*/ */
char *mountpoint; char *mountpoint;
char *ns_mountpoint;
unsigned flags; unsigned flags;
int master_id; int master_id;
int shared_id; int shared_id;

View File

@@ -1669,6 +1669,7 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
pm->mountpoint = xmalloc(len); pm->mountpoint = xmalloc(len);
if (!pm->mountpoint) if (!pm->mountpoint)
goto err; goto err;
pm->ns_mountpoint = pm->mountpoint + root_len;
/* /*
* For bind-mounts we would also fix the root here * For bind-mounts we would also fix the root here
* too, but bind-mounts restore merges mountpoint * too, but bind-mounts restore merges mountpoint