[CRIU] Re: [PATCH 3/4] restorer: Do restore futex robust lists
Cyrill Gorcunov
gorcunov at openvz.org
Fri Aug 10 04:32:39 EDT 2012
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);
Cyrill
More information about the CRIU
mailing list