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

Cyrill Gorcunov gorcunov at openvz.org
Tue Feb 7 07:24:56 EST 2012


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
	  ...

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