[CRIU] [PATCH v4 03/17] regular files: protobuf "unreachable" field introduced

Pavel Emelyanov xemul at virtuozzo.com
Mon Jun 6 05:00:21 PDT 2016


On 06/02/2016 03:03 PM, Stanislav Kinsburskiy wrote:
> 
> 
> 02.06.2016 13:09, Pavel Emelyanov пишет:
>> On 05/20/2016 02:37 PM, Stanislav Kinsburskiy wrote:
>>> Will be used to determine whether this file have to be created prior to  open
>>> on restore.
>>>
>>> Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
>>> ---
>>>   criu/files-reg.c     |   10 ++++++++++
>>>   images/regfile.proto |    1 +
>>>   2 files changed, 11 insertions(+)
>>>
>>> diff --git a/criu/files-reg.c b/criu/files-reg.c
>>> index 73b2908..e3da972 100644
>>> --- a/criu/files-reg.c
>>> +++ b/criu/files-reg.c
>>> @@ -1101,6 +1101,13 @@ static bool should_check_size(int flags)
>>>   	return true;
>>>   }
>>>   
>>> +static bool path_is_unreachable(struct fd_link *link, const struct fd_parms *parms)
>>> +{
>>> +	if (parms->fs_type == NFS_SUPER_MAGIC)
>>> +		return true;
>>> +	return false;
>>> +}
>>> +
>>>   int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p)
>>>   {
>>>   	struct fd_link _link, *link;
>>> @@ -1168,6 +1175,9 @@ ext:
>>>   	rfe.has_mode = true;
>>>   	rfe.mode = p->stat.st_mode;
>>>   
>>> +	rfe.has_unreachable	= true;
>>> +	rfe.unreachable		= path_is_unreachable(link, p);
>> Did you try to create remap entry for such files?
>>
> 
> No, I didn't.
> The reason is "unreachable" tag can be assigned to any file, including 
> remapped ones. IOW, it's another level of abstraction.

Disagree. How would you assign "unreachable" to dead-pid remap?

>>> +
>>>   	rimg = img_from_set(glob_imgset, CR_FD_REG_FILES);
>>>   	return pb_write_one(rimg, &rfe, PB_REG_FILE);
>>>   }
>>> diff --git a/images/regfile.proto b/images/regfile.proto
>>> index 25b1e41..f88603e 100644
>>> --- a/images/regfile.proto
>>> +++ b/images/regfile.proto
>>> @@ -11,4 +11,5 @@ message reg_file_entry {
>>>   	optional uint64		size	= 8;
>>>   	optional bool		ext	= 9;
>>>   	optional uint32         mode    = 10;
>>> +	optional bool		unreachable     = 11;
>>>   }
>>>
>>> _______________________________________________
>>> CRIU mailing list
>>> CRIU at openvz.org
>>> https://lists.openvz.org/mailman/listinfo/criu
>>> .
>>>
> 
> .
> 



More information about the CRIU mailing list