[CRIU] Inherit FD via RPC

Adrian Reber adrian at lisas.de
Fri Aug 3 19:16:48 MSK 2018


On Fri, Aug 03, 2018 at 03:28:04PM +0000, Adrian Reber wrote:
> Hello Andrei,
> 
> this is my next try to get inherit-fd support into RPC.
> 
> For each inherit-fd a new notify message ('request-inherit-fd') is sent to
> the RPC client, which then transmits the actual FD back to CRIU.
> 
> I have this working in combination with runc and I am just sending this
> out if this is how you described it.
> 
> I have not waited for the travis results but just wanted to get some
> feedback from you. Let me know if you think this is the right way to
> go.
> 
> I still would change the commit messages to have more details and
> fix errors if travis or jenkins complains.

I just saw that runc already uses the existing inherit-fd interface:

        for i := range fds {
                if s := fds[i]; strings.Contains(s, "pipe:") {
                        inheritFd := new(criurpc.InheritFd)
                        inheritFd.Key = proto.String(s)
                        inheritFd.Fd = proto.Int32(int32(i))
                        req.Opts.InheritFd = append(req.Opts.InheritFd, inheritFd)
                }
        }

The debug output of runc:

CRIU option InheritFd with value [key:\"pipe:[168249]\" fd:0 key:\"pipe:[168230]\" fd:1  key:\"pipe:[168230]\" fd:2 ]

So this probably only works because FD 0, 1, 2 are always the same.

So runc would need to change its behaviour at this point. This could be
done based on the CRIU version detected.

		Adrian


More information about the CRIU mailing list