[CRIU] [PATCH v2 03/17] regular files: protobuf "unreachable" field introduced

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu May 19 02:23:07 PDT 2016


Will be used to determine whether this file have to be created prior to  open
on restore.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 criu/files-reg.c     |   10 ++++++++++
 images/regfile.proto |    1 +
 2 files changed, 11 insertions(+)

diff --git a/criu/files-reg.c b/criu/files-reg.c
index 73b2908..e3da972 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -1101,6 +1101,13 @@ static bool should_check_size(int flags)
 	return true;
 }
 
+static bool path_is_unreachable(struct fd_link *link, const struct fd_parms *parms)
+{
+	if (parms->fs_type == NFS_SUPER_MAGIC)
+		return true;
+	return false;
+}
+
 int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p)
 {
 	struct fd_link _link, *link;
@@ -1168,6 +1175,9 @@ ext:
 	rfe.has_mode = true;
 	rfe.mode = p->stat.st_mode;
 
+	rfe.has_unreachable	= true;
+	rfe.unreachable		= path_is_unreachable(link, p);
+
 	rimg = img_from_set(glob_imgset, CR_FD_REG_FILES);
 	return pb_write_one(rimg, &rfe, PB_REG_FILE);
 }
diff --git a/images/regfile.proto b/images/regfile.proto
index 25b1e41..f88603e 100644
--- a/images/regfile.proto
+++ b/images/regfile.proto
@@ -11,4 +11,5 @@ message reg_file_entry {
 	optional uint64		size	= 8;
 	optional bool		ext	= 9;
 	optional uint32         mode    = 10;
+	optional bool		unreachable     = 11;
 }



More information about the CRIU mailing list