[CRIU] [PATCH 4/7] img: Needed declarations for irmap-cache image file

Pavel Emelyanov xemul at parallels.com
Thu Jan 30 02:24:09 PST 2014


The irmap-cache is PB-file (like the stat-* ones).
See commtns in next patches for more details.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 cr-show.c               | 1 +
 image-desc.c            | 5 +++++
 include/image-desc.h    | 2 ++
 include/magic.h         | 2 ++
 include/protobuf-desc.h | 1 +
 protobuf/fh.proto       | 6 ++++++
 6 files changed, 17 insertions(+)

diff --git a/cr-show.c b/cr-show.c
index a128b95..87aa6b6 100644
--- a/cr-show.c
+++ b/cr-show.c
@@ -320,6 +320,7 @@ static struct show_image_info show_infos[] = {
 	SHOW_PLAIN(RLIMIT),
 	SHOW_PLAIN(TUNFILE),
 	SHOW_PLAINS(EXT_FILE),
+	SHOW_PLAIN(IRMAP_CACHE),
 
 	{ TCP_STREAM_MAGIC,	PB_TCP_STREAM,		true,	show_tcp_stream, "1:%u 2:%u 3:%u 4:%u 12:%u", },
 	{ STATS_MAGIC,		PB_STATS,		true,	NULL, "1.1:%u 1.2:%u 1.3:%u 1.4:%u 1.5:%Lu 1.6:%Lu 1.7:%Lu", },
diff --git a/image-desc.c b/image-desc.c
index 1a02e42..aa879e6 100644
--- a/image-desc.c
+++ b/image-desc.c
@@ -81,4 +81,9 @@ struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX] = {
 		.fmt	= "stats-%s",
 		.magic	= STATS_MAGIC,
 	},
+
+	[CR_FD_IRMAP_CACHE] = {
+		.fmt	= "irmap-cache",
+		.magic	= IRMAP_CACHE_MAGIC,
+	},
 };
diff --git a/include/image-desc.h b/include/image-desc.h
index 3899fc6..47603f5 100644
--- a/include/image-desc.h
+++ b/include/image-desc.h
@@ -87,6 +87,8 @@ enum {
 	CR_FD_PAGES_OLD,
 	CR_FD_SHM_PAGES_OLD,
 
+	CR_FD_IRMAP_CACHE,
+
 	CR_FD_MAX
 };
 
diff --git a/include/magic.h b/include/magic.h
index c9a5622..2ec553e 100644
--- a/include/magic.h
+++ b/include/magic.h
@@ -81,4 +81,6 @@
 #define PAGES_OLD_MAGIC		PAGEMAP_MAGIC
 #define SHM_PAGES_OLD_MAGIC	PAGEMAP_MAGIC
 
+#define IRMAP_CACHE_MAGIC	0x57004059 /* Ivanovo */
+
 #endif /* __CR_MAGIC_H__ */
diff --git a/include/protobuf-desc.h b/include/protobuf-desc.h
index 5daeb13..0cf41fd 100644
--- a/include/protobuf-desc.h
+++ b/include/protobuf-desc.h
@@ -49,6 +49,7 @@ enum {
 	PB_PAGEMAP,
 	PB_SIGINFO,
 	PB_TUNFILE,
+	PB_IRMAP_CACHE,
 
 	/* PB_AUTOGEN_STOP */
 
diff --git a/protobuf/fh.proto b/protobuf/fh.proto
index 63aa7a2..b0491dc 100644
--- a/protobuf/fh.proto
+++ b/protobuf/fh.proto
@@ -10,3 +10,9 @@ message fh_entry {
 	repeated uint64		handle	= 3;
 	optional string		path	= 4;
 }
+
+message irmap_cache_entry {
+	required uint32		dev = 1;
+	required uint64		inode = 2;
+	required string		path = 3;
+}
-- 
1.8.4.2


More information about the CRIU mailing list