[CRIU] Re: [PATCH 2/4] image: add functions to close and re-open the network listen socket

Adrian Reber adrian at lisas.de
Mon Aug 20 10:20:04 EDT 2012


On Thu, Aug 16, 2012 at 08:10:41PM +0400, Pavel Emelyanov wrote:
> On 08/16/2012 07:56 PM, Adrian Reber wrote:
> > On Wed, Aug 15, 2012 at 02:53:13PM +0400, Pavel Emelyanov wrote:
> >> On 08/15/2012 01:54 PM, Adrian Reber wrote:
> >>> During the restore of the file descriptors all open network
> >>> sockets have to be closed.
> >>
> >> I don't quite understand this requirement. Can you elaborate, please?
> > 
> > I think it is during prepare_fs(). If the network socket is still open
> > (using fd=3) prepare_fs() fails if the program to restore wants to open
> > that file descriptor. Maybe there is another way to handle it but
> > closing and later reopening it was my only idea.
> 
> We face this when keep an image file with fds open. There's the move_img_fd()
> thing for resolving this conflict, you should use it for image socket as well.

I think I need some help here. How do I now where to move my socket FDs?

My restore test case needs the FDs 3 and 4, but 3 is used by the listen
socket. How would I move the network listen socket to 5 or higher? How
do I know which is the highest FD which will be free and not needed by
the program which will be restored?

		Adrian


More information about the CRIU mailing list