[CRIU] [PATCH 02/11] mount: save group and master in image file (v2)
Andrey Vagin
avagin at openvz.org
Tue Jul 30 12:25:27 EDT 2013
They are required for restoring shared and slave mounts
v2: use the same names of variables in image and in code
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
mount.c | 6 ++++++
protobuf/mnt.proto | 3 +++
2 files changed, 9 insertions(+)
diff --git a/mount.c b/mount.c
index 81cafe1..b2ffc87 100644
--- a/mount.c
+++ b/mount.c
@@ -551,6 +551,10 @@ static int dump_one_mountpoint(struct mount_info *pm, int fd)
me.mountpoint = pm->mountpoint;
me.source = pm->source;
me.options = pm->options;
+ me.shared_id = pm->shared_id;
+ me.has_shared_id = true;
+ me.master_id = pm->master_id;
+ me.has_master_id = true;
if (!me.fstype && !is_root_mount(pm)) {
pr_err("FS mnt %s dev %#x root %s unsupported\n",
@@ -837,6 +841,8 @@ static int populate_mnt_ns(int ns_pid)
pm->parent_mnt_id = me->parent_mnt_id;
pm->s_dev = me->root_dev;
pm->flags = me->flags;
+ pm->shared_id = me->shared_id;
+ pm->master_id = me->master_id;
/* FIXME: abort unsupported early */
pm->fstype = decode_fstype(me->fstype);
diff --git a/protobuf/mnt.proto b/protobuf/mnt.proto
index 209c2ce..ea1ad3c 100644
--- a/protobuf/mnt.proto
+++ b/protobuf/mnt.proto
@@ -20,4 +20,7 @@ message mnt_entry {
required string mountpoint = 7;
required string source = 8;
required string options = 9;
+
+ optional uint32 shared_id = 10;
+ optional uint32 master_id = 11;
}
--
1.8.3.1
More information about the CRIU
mailing list