[CRIU] Re: [PATCH 3/4] restorer: Do restore futex robust lists

Pavel Emelyanov xemul at parallels.com
Fri Aug 10 04:33:39 EDT 2012


On 08/10/2012 12:32 PM, Cyrill Gorcunov wrote:
> On Fri, Aug 10, 2012 at 12:21:46PM +0400, Pavel Emelyanov wrote:
>> If the default value is not specified for an optional element, a type-specific
>> default value is used instead: for strings, the default value is the empty string.
>> For bools, the default value is false. For numeric types, the default value is
>> zero. For enums, the default value is the first value listed in the enum's type
>> definition.
> 
> Look, the initialization of pb descriptor (the interesting case I consider is
> one where we use new .proto but old binary data, since otherwise unknown fields
> are just ignored) is done via ->init message. For our protobuf file this means
> "has" fields are set to false and we're on safe side then.
> 
> Ie the part of pb code which is responsible for init is
> 
> protobuf_c_message_unpack
>   if (desc->message_init != NULL)
>     protobuf_c_message_init (desc, rv);
>   else
>     protobuf_c_message_init_generic (desc, rv);

I quoted documentation ;) No need to look in the code then.

> 	Cyrill
> .
> 



More information about the CRIU mailing list