[CRIU] [PATCH v3 01/17] reg_file_entry: add "mode" variable

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu May 19 03:57:12 PDT 2016


Mode is required for temprorary file creation, when mountpoint is not
available on restore (in case of NFS, for example).

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

diff --git a/criu/files-reg.c b/criu/files-reg.c
index fd36ae9..73b2908 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -1165,6 +1165,9 @@ ext:
 		rfe.size = p->stat.st_size;
 	}
 
+	rfe.has_mode = true;
+	rfe.mode = p->stat.st_mode;
+
 	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 e25d589..25b1e41 100644
--- a/images/regfile.proto
+++ b/images/regfile.proto
@@ -10,4 +10,5 @@ message reg_file_entry {
 	optional sint32		mnt_id	= 7 [default = -1];
 	optional uint64		size	= 8;
 	optional bool		ext	= 9;
+	optional uint32         mode    = 10;
 }



More information about the CRIU mailing list