[CRIU] [PATCH 1/6] protobuf: add opts.proto

Ruslan Kuprieiev kupruser at gmail.com
Fri Jan 16 12:55:52 PST 2015


We have registered unique field number to use for all kinds of custom
options in our project. So, if you want to add, for example, custom
_message_ option use 1018 field number, as different options have
 separated namespaces.

If you want to add one more _field_ option, just add it as optional
field to message CRIU_Opts.

It is also worth noting, that _protobuf-c_ doesn't support custom options,
so they are only to be used with _protobuf_.

Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
---
 protobuf/opts.proto | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 protobuf/opts.proto

diff --git a/protobuf/opts.proto b/protobuf/opts.proto
new file mode 100644
index 0000000..a04bfad
--- /dev/null
+++ b/protobuf/opts.proto
@@ -0,0 +1,10 @@
+import "google/protobuf/descriptor.proto";
+
+message CRIU_Opts {
+	optional bool hex = 1; // Idicate that CRIT should treat this field as hex.
+}
+
+extend google.protobuf.FieldOptions {
+	// Registered unique number to use for all kinds of custom options.
+	optional CRIU_Opts criu = 1018;
+}
-- 
2.1.0



More information about the CRIU mailing list