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

Pavel Emelyanov xemul at parallels.com
Mon Jan 19 02:07:16 PST 2015


On 01/16/2015 11:55 PM, Ruslan Kuprieiev wrote:
> 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_.

But if protobuf-c doesn't support this, how does criu compile after you
patch the .proto files?

> 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;
> +}
> 



More information about the CRIU mailing list