[CRIU] [PATCH 2/6] cpuinfo: Prepare protobuf and magic

Cyrill Gorcunov gorcunov at openvz.org
Mon Sep 1 02:06:50 PDT 2014


Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-show.c               | 1 +
 image-desc.c            | 1 +
 include/image-desc.h    | 1 +
 include/magic.h         | 1 +
 include/protobuf-desc.h | 5 +++--
 protobuf-desc.c         | 1 +
 6 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/cr-show.c b/cr-show.c
index 0e1a2c6dccf7..b70e9d16a010 100644
--- a/cr-show.c
+++ b/cr-show.c
@@ -322,6 +322,7 @@ static struct show_image_info show_infos[] = {
 	SHOW_PLAIN(TUNFILE),
 	SHOW_PLAINS(EXT_FILE),
 	SHOW_PLAIN(IRMAP_CACHE),
+	SHOW_PLAIN(CPUINFO),
 
 	{ FILE_LOCKS_MAGIC,	PB_FILE_LOCK,		false,	NULL, "3:%u", },
 	{ TCP_STREAM_MAGIC,	PB_TCP_STREAM,		true,	show_tcp_stream, "1:%u 2:%u 3:%u 4:%u 12:%u", },
diff --git a/image-desc.c b/image-desc.c
index 616cbe9dd558..3257b5dbfe51 100644
--- a/image-desc.c
+++ b/image-desc.c
@@ -79,6 +79,7 @@ struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX] = {
 	FD_ENTRY(TUNFILE,	"tunfile"),
 	FD_ENTRY(CGROUP,	"cgroup"),
 	FD_ENTRY(TIMERFD,	"timerfd"),
+	FD_ENTRY(CPUINFO,	"cpuinfo"),
 
 	[CR_FD_STATS] = {
 		.fmt	= "stats-%s",
diff --git a/include/image-desc.h b/include/image-desc.h
index ab592a183bb6..77d8b63515a3 100644
--- a/include/image-desc.h
+++ b/include/image-desc.h
@@ -90,6 +90,7 @@ enum {
 	CR_FD_FILE_LOCKS_PID,
 
 	CR_FD_IRMAP_CACHE,
+	CR_FD_CPUINFO,
 
 	CR_FD_SIGNAL,
 	CR_FD_PSIGNAL,
diff --git a/include/magic.h b/include/magic.h
index 5192a60a9b5d..ff00a51ff3ee 100644
--- a/include/magic.h
+++ b/include/magic.h
@@ -74,6 +74,7 @@
 #define TUNFILE_MAGIC		0x57143751 /* Kalyazin */
 #define CGROUP_MAGIC		0x59383330 /* Tikhvin */
 #define TIMERFD_MAGIC		0x50493712 /* Korocha */
+#define CPUINFO_MAGIC		0x61404013 /* Nyandoma */
 
 #define IFADDR_MAGIC		RAW_IMAGE_MAGIC
 #define ROUTE_MAGIC		RAW_IMAGE_MAGIC
diff --git a/include/protobuf-desc.h b/include/protobuf-desc.h
index 01c9f4c153bf..f8b6d3330ae1 100644
--- a/include/protobuf-desc.h
+++ b/include/protobuf-desc.h
@@ -52,14 +52,15 @@ enum {
 	PB_IRMAP_CACHE,
 	PB_CGROUP,
 	PB_TIMERFD,
+	PB_CPUINFO,
 
 	/* PB_AUTOGEN_STOP */
 
 	PB_PAGEMAP_HEAD,
 	PB_IDS,
 	PB_SIGACT,
-	PB_NETDEV,
-	PB_REMAP_FPATH,		/* 50 */
+	PB_NETDEV,		/* 50 */
+	PB_REMAP_FPATH,
 	PB_SK_QUEUES,
 	PB_IPCNS_MSG,
 	PB_IPCNS_MSG_ENT,
diff --git a/protobuf-desc.c b/protobuf-desc.c
index b97418bb2fd9..ba1b37754fe3 100644
--- a/protobuf-desc.c
+++ b/protobuf-desc.c
@@ -59,6 +59,7 @@
 #include "protobuf/tun.pb-c.h"
 #include "protobuf/cgroup.pb-c.h"
 #include "protobuf/timerfd.pb-c.h"
+#include "protobuf/cpuinfo.pb-c.h"
 
 struct cr_pb_message_desc cr_pb_descs[PB_MAX];
 
-- 
1.9.3



More information about the CRIU mailing list