Merge pull request #215 from boucher/huikang-patch

Add hooks for passing explicit veth pairs for forwarding to CRIU
This commit is contained in:
Mrunal Patel 2015-08-24 21:23:29 -07:00
commit 2f4c229a8c
2 changed files with 12 additions and 0 deletions

View File

@ -532,6 +532,12 @@ func (c *linuxContainer) Restore(process *Process, criuOpts *CriuOpts) error {
break
}
}
for _, i := range criuOpts.VethPairs {
veth := new(criurpc.CriuVethPair)
veth.IfOut = proto.String(i.HostInterfaceName)
veth.IfIn = proto.String(i.ContainerInterfaceName)
req.Opts.Veths = append(req.Opts.Veths, veth)
}
var (
fds []string

View File

@ -5,6 +5,11 @@ type CriuPageServerInfo struct {
Port int32 // port number of CRIU page server
}
type VethPairName struct {
ContainerInterfaceName string
HostInterfaceName string
}
type CriuOpts struct {
ImagesDirectory string // directory for storing image files
WorkDirectory string // directory to cd and write logs/pidfiles/stats to
@ -14,4 +19,5 @@ type CriuOpts struct {
ShellJob bool // allow to dump and restore shell jobs
FileLocks bool // handle file locks, for safety
PageServer CriuPageServerInfo // allow to dump to criu page server
VethPairs []VethPairName // pass the veth to criu when restore
}