[CRIU] [PATCH 1/2] image: Add comments about VMA_AREA constants and drop FORCE_READ flag

Cyrill Gorcunov gorcunov at openvz.org
Wed Feb 25 07:42:39 PST 2015


Force-read came from very first dev version of CRIU (even before 1.0 release)
and never been used actually in image.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 include/image.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++++---
 util.c          |  1 -
 2 files changed, 48 insertions(+), 4 deletions(-)

diff --git a/include/image.h b/include/image.h
index 9c711c0a7c68..7c79b999140f 100644
--- a/include/image.h
+++ b/include/image.h
@@ -38,12 +38,57 @@
 #define USK_SERVICE	(1 << 1)
 #define USK_CALLBACK	(1 << 2)
 
+/*
+ * VMA_AREA status:
+ *
+ *  - none
+ *	VmaEntry is just allocated and has not been used
+ *	for anything yet
+ *  - regular
+ *  	VmaEntry represent some memory area which should be
+ *  	dumped and restored; this is a general sign that we
+ *  	should not skip the area content from processing in
+ *  	compare with special areas such as vsyscall
+ *  - stack
+ *  	the memory area is used in application stack so we
+ *  	should be careful about guard page here
+ *  - vsyscall
+ *  	special memory area injected into the task memory
+ *  	space by the kernel itself, represent virtual syscall
+ *  	implementation and it is specific to every kernel version,
+ *  	its contents should not be dumped ever
+ *  - vdso,vvar
+ *  	the vDSO area, it might reqire additional memory
+ *  	contents modification especially when tasks are
+ *  	migrating between different kernel versions
+ *  - heap
+ *  	"heap" area in application, currently for inforamtion only
+ *  - file private
+ *  	stands for privately memory mapped files
+ *  - file shared
+ *  	stands for shared memory mapped files
+ *  - anon shared
+ *  	represent shared anonymous memory areas
+ *  - anon private
+ *  	represent private anonymous memory areas
+ *  - SysV IPC
+ *  	IPC shared memory area
+ *  - socket
+ *  	memory map for socket
+ *  - AIO ring
+ *  	memory area serves AIO buffers
+ *  - unsupported
+ *  	stands for any unknown memory areas, usually means
+ *  	we don't know how to work with it and should stop
+ *  	processing exiting with error; while the rest of bits
+ *  	are part of image ABI, this particular one must never
+ *  	be used in image.
+ */
 #define VMA_AREA_NONE		(0 <<  0)
-#define VMA_AREA_REGULAR	(1 <<  0)	/* Dumpable area */
+#define VMA_AREA_REGULAR	(1 <<  0)
 #define VMA_AREA_STACK		(1 <<  1)
 #define VMA_AREA_VSYSCALL	(1 <<  2)
 #define VMA_AREA_VDSO		(1 <<  3)
-#define VMA_FORCE_READ		(1 <<  4)	/* VMA changed to be readable */
 #define VMA_AREA_HEAP		(1 <<  5)
 
 #define VMA_FILE_PRIVATE	(1 <<  6)
@@ -56,7 +101,7 @@
 #define VMA_AREA_VVAR		(1 <<  12)
 #define VMA_AREA_AIORING	(1 <<  13)
 
-#define VMA_UNSUPP		(1 <<  31)	/* Unsupported VMA */
+#define VMA_UNSUPP		(1 <<  31)
 
 #define CR_CAP_SIZE	2
 
diff --git a/util.c b/util.c
index e91f3fe2da4e..03dc2f6672bc 100644
--- a/util.c
+++ b/util.c
@@ -62,7 +62,6 @@ static void vma_opt_str(const struct vma_area *v, char *opt)
 	opt2s(VMA_AREA_VSYSCALL, "vsys");
 	opt2s(VMA_AREA_VDSO, "vdso");
 	opt2s(VMA_AREA_VVAR, "vvar");
-	opt2s(VMA_FORCE_READ, "frd");
 	opt2s(VMA_AREA_HEAP, "heap");
 	opt2s(VMA_FILE_PRIVATE, "fp");
 	opt2s(VMA_FILE_SHARED, "fs");
-- 
1.9.3



More information about the CRIU mailing list