[CRIU] [PATCH 6/6] protobuf: add criu.hex = true options to int64 fields

Ruslan Kuprieiev kupruser at gmail.com
Mon Jan 19 02:50:27 PST 2015


On 01/19/2015 12:47 PM, Pavel Emelyanov wrote:
> On 01/19/2015 01:32 PM, Ruslan Kuprieiev wrote:
>> On 01/19/2015 12:09 PM, Pavel Emelyanov wrote:
>>> On 01/16/2015 11:55 PM, Ruslan Kuprieiev wrote:
>>>> Signed-off-by: Ruslan Kuprieiev <kupruser at gmail.com>
>>>> ---
>>>>    protobuf/core-x86.proto | 64 +++++++++++++++++++++++++------------------------
>>>>    1 file changed, 33 insertions(+), 31 deletions(-)
>>>>
>>>> diff --git a/protobuf/core-x86.proto b/protobuf/core-x86.proto
>>>> index b6eb0b3..0b1066b 100644
>>>> --- a/protobuf/core-x86.proto
>>>> +++ b/protobuf/core-x86.proto
>>>> @@ -1,35 +1,37 @@
>>>> +import "opts.proto";
>>>> +
>>>>    message user_x86_regs_entry {
>>>> -	required uint64			r15		=  1;
>>>> -	required uint64			r14		=  2;
>>>> -	required uint64			r13		=  3;
>>>> -	required uint64			r12		=  4;
>>>> -	required uint64			bp		=  5;
>>>> -	required uint64			bx		=  6;
>>>> -	required uint64			r11		=  7;
>>>> -	required uint64			r10		=  8;
>>>> -	required uint64			r9		=  9;
>>>> -	required uint64			r8		= 10;
>>>> -	required uint64			ax		= 11;
>>>> -	required uint64			cx		= 12;
>>>> -	required uint64			dx		= 13;
>>>> -	required uint64			si		= 14;
>>>> -	required uint64			di		= 15;
>>>> -	required uint64			orig_ax		= 16;
>>>> -	required uint64			ip		= 17;
>>>> -	required uint64			cs		= 18;
>>>> -	required uint64			flags		= 19;
>>>> -	required uint64			sp		= 20;
>>>> -	required uint64			ss		= 21;
>>>> -	required uint64			fs_base		= 22;
>>>> -	required uint64			gs_base		= 23;
>>>> -	required uint64			ds		= 24;
>>>> -	required uint64			es		= 25;
>>>> -	required uint64			fs		= 26;
>>>> -	required uint64			gs		= 27;
>>>> +	required uint64			r15		=  1[(criu).hex = true];
>>>> +	required uint64			r14		=  2[(criu).hex = true];
>>>> +	required uint64			r13		=  3[(criu).hex = true];
>>>> +	required uint64			r12		=  4[(criu).hex = true];
>>>> +	required uint64			bp		=  5[(criu).hex = true];
>>>> +	required uint64			bx		=  6[(criu).hex = true];
>>>> +	required uint64			r11		=  7[(criu).hex = true];
>>>> +	required uint64			r10		=  8[(criu).hex = true];
>>>> +	required uint64			r9		=  9[(criu).hex = true];
>>>> +	required uint64			r8		= 10[(criu).hex = true];
>>>> +	required uint64			ax		= 11[(criu).hex = true];
>>>> +	required uint64			cx		= 12[(criu).hex = true];
>>>> +	required uint64			dx		= 13[(criu).hex = true];
>>>> +	required uint64			si		= 14[(criu).hex = true];
>>>> +	required uint64			di		= 15[(criu).hex = true];
>>>> +	required uint64			orig_ax		= 16[(criu).hex = true];
>>>> +	required uint64			ip		= 17[(criu).hex = true];
>>>> +	required uint64			cs		= 18[(criu).hex = true];
>>>> +	required uint64			flags		= 19[(criu).hex = true];
>>>> +	required uint64			sp		= 20[(criu).hex = true];
>>>> +	required uint64			ss		= 21[(criu).hex = true];
>>>> +	required uint64			fs_base		= 22[(criu).hex = true];
>>>> +	required uint64			gs_base		= 23[(criu).hex = true];
>>>> +	required uint64			ds		= 24[(criu).hex = true];
>>>> +	required uint64			es		= 25[(criu).hex = true];
>>>> +	required uint64			fs		= 26[(criu).hex = true];
>>>> +	required uint64			gs		= 27[(criu).hex = true];
>>> I'm not quite happy with marking all 27 fields with this. Can we
>>> teach crit to "inherit" this option? Like this -- this object, the
>>> user_x86_regs_entry, is referenced by thread_info_x86's gpregs field.
>>> So let's mark the "gpregs" field with [(criu).hex = true] and make
>>> crit apply this option to the whole "submessage" pointed by it.
>>>
>>> Can we?
>>>
>> Yes, we can. But how many of those "all hex" messages do we have?
> Let's see... sa_entry, regs_entry-s (for all archs), ... I think
> it's all.
>
>> I'm afraid that marking messages as hex might be confusing in both
>> .proto files and CRIT source.
> Why in CRIT sources? No, only in .proto files. CRIT should just we
> taught to "remember" the criu.hex option into submessages.
>
> Thanks,
> Pavel
>

Ok, could you drop this particular one, please, and consider the other 
patches from this set?
I will send an incremental one separately to support "all hex" messages.




More information about the CRIU mailing list