[CRIU] [PATCH 02/11] protobuf: add a new description for saving file-lock

Qiang Huang h.huangqiang at huawei.com
Thu Jan 17 03:09:28 EST 2013


We need a new protobuf description for file-lock.

Originally-signed-off-by: Zheng Gu <cengku.gu at huawei.com>
Signed-off-by: Qiang Huang <h.huangqiang at huawei.com>
---
 include/protobuf.h       |    1 +
 protobuf.c               |    2 ++
 protobuf/Makefile        |    1 +
 protobuf/file-lock.proto |    8 ++++++++
 4 files changed, 12 insertions(+), 0 deletions(-)
 create mode 100644 protobuf/file-lock.proto

diff --git a/include/protobuf.h b/include/protobuf.h
index 6851c22..14677e2 100644
--- a/include/protobuf.h
+++ b/include/protobuf.h
@@ -43,6 +43,7 @@ enum {
 	PB_INOTIFY_WD,
 	PB_TTY,
 	PB_TTY_INFO,
+	PB_FILE_LOCK,
 
 	PB_MAX
 };
diff --git a/protobuf.c b/protobuf.c
index f5ec1ea..fd5131e 100644
--- a/protobuf.c
+++ b/protobuf.c
@@ -49,6 +49,7 @@
 #include "protobuf/netdev.pb-c.h"
 #include "protobuf/tcp-stream.pb-c.h"
 #include "protobuf/tty.pb-c.h"
+#include "protobuf/file-lock.pb-c.h"
 
 typedef size_t (*pb_getpksize_t)(void *obj);
 typedef size_t (*pb_pack_t)(void *obj, void *where);
@@ -125,6 +126,7 @@ void cr_pb_init(void)
 	CR_PB_DESC(PACKETSK,		PacketSock,	packet_sock);
 	CR_PB_DESC(TTY,			TtyFile,	tty_file);
 	CR_PB_DESC(TTY_INFO,		TtyInfo,	tty_info);
+	CR_PB_DESC(FILE_LOCK,		FileLock,	file_lock);
 }
 
 /*
diff --git a/protobuf/Makefile b/protobuf/Makefile
index c5e9314..2889f14 100644
--- a/protobuf/Makefile
+++ b/protobuf/Makefile
@@ -37,6 +37,7 @@ PROTO_FILES	+= vma.proto
 PROTO_FILES	+= core.proto
 PROTO_FILES	+= netdev.proto
 PROTO_FILES	+= tty.proto
+PROTO_FILES	+= file-lock.proto
 
 PROTO_HDRS	:= $(patsubst %.proto,%.pb-c.h,$(PROTO_FILES))
 PROTO_SRCS	:= $(patsubst %.proto,%.pb-c.c,$(PROTO_FILES))
diff --git a/protobuf/file-lock.proto b/protobuf/file-lock.proto
new file mode 100644
index 0000000..e0aaaa4
--- /dev/null
+++ b/protobuf/file-lock.proto
@@ -0,0 +1,8 @@
+message file_lock_entry {
+    required uint32	flag  = 1;
+    required uint32	type  = 2;
+    required int32	pid   = 3;
+    required int32	fd    = 4;
+    required int64	start = 5;
+    required int64	len   = 6;
+}
-- 
1.7.1




More information about the CRIU mailing list