[CRIU] Re: [PATCH 2/4] restore: Add checkpoint/restore for /proc/pid/exe symlink

Pavel Emelyanov xemul at parallels.com
Tue Feb 7 07:32:34 EST 2012


On 02/07/2012 04:24 PM, Cyrill Gorcunov wrote:
> On Tue, Feb 07, 2012 at 04:22:02PM +0400, Cyrill Gorcunov wrote:
>> On Tue, Feb 07, 2012 at 04:17:08PM +0400, Pavel Emelyanov wrote:
>>>> @@ -230,6 +231,16 @@ static int restore_cwd(struct fdinfo_entry *fe, int fd)
>>>>  	return 0;
>>>>  }
>>>>  
>>>> +static int restore_exe_early(struct fdinfo_entry *fe, int fd)
>>>> +{
>>>> +	char path[PATH_MAX];
>>>> +
>>>> +	if (get_file_path(path, fe, fd))
>>>> +		return -1;
>>>> +
>>>> +	pr_info("Skips restoring EXE (%s) symlink at this stage\n", path);
>>>> +	return 0;
>>>
>>> What is this function for?
>>>
>>
>> It's informative message, we can live without it but note that we have
>> to skip EXE name in image, so if we drop this function we need to do
>> lseek somewhere else in code and skip the name of exe link in image
>> reading procedure.
>>
> 
> More detailed -- the image will look like
> 
> 	| magic
> 	+--
> 	| cwd entry
> 	+--
> 	| exe entry
> 	+--
> 	| all other entries
> 	  ...

This doesn't matter where in the file each entry is. An fdinfo entry has an addr in 
it and you should check it anyway.

> so when we read it and restore everything but the exe entry
> (which is restored later) -- we need to skip it somehow so
> reading procedure wouldn't be interrupted.
> 
> 	Cyrill
> .
> 



More information about the CRIU mailing list