checkpoint: add support of the EmptyNs criu option
This options is set a namespace mask which will not be dumped and restored. For example, we are going to use this option to restore network for docker containers. CRIU will create a network namespace and call a libnetwork hook to restore network devices, addresses and routes. Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
a2a771b8e2
commit
46c25be297
|
@ -519,6 +519,7 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
|
||||||
TcpEstablished: proto.Bool(criuOpts.TcpEstablished),
|
TcpEstablished: proto.Bool(criuOpts.TcpEstablished),
|
||||||
ExtUnixSk: proto.Bool(criuOpts.ExternalUnixConnections),
|
ExtUnixSk: proto.Bool(criuOpts.ExternalUnixConnections),
|
||||||
FileLocks: proto.Bool(criuOpts.FileLocks),
|
FileLocks: proto.Bool(criuOpts.FileLocks),
|
||||||
|
EmptyNs: proto.Uint32(criuOpts.EmptyNs),
|
||||||
}
|
}
|
||||||
|
|
||||||
// append optional criu opts, e.g., page-server and port
|
// append optional criu opts, e.g., page-server and port
|
||||||
|
@ -656,6 +657,7 @@ func (c *linuxContainer) Restore(process *Process, criuOpts *CriuOpts) error {
|
||||||
ExtUnixSk: proto.Bool(criuOpts.ExternalUnixConnections),
|
ExtUnixSk: proto.Bool(criuOpts.ExternalUnixConnections),
|
||||||
TcpEstablished: proto.Bool(criuOpts.TcpEstablished),
|
TcpEstablished: proto.Bool(criuOpts.TcpEstablished),
|
||||||
FileLocks: proto.Bool(criuOpts.FileLocks),
|
FileLocks: proto.Bool(criuOpts.FileLocks),
|
||||||
|
EmptyNs: proto.Uint32(criuOpts.EmptyNs),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,4 +33,5 @@ type CriuOpts struct {
|
||||||
PageServer CriuPageServerInfo // allow to dump to criu page server
|
PageServer CriuPageServerInfo // allow to dump to criu page server
|
||||||
VethPairs []VethPairName // pass the veth to criu when restore
|
VethPairs []VethPairName // pass the veth to criu when restore
|
||||||
ManageCgroupsMode cg_mode // dump or restore cgroup mode
|
ManageCgroupsMode cg_mode // dump or restore cgroup mode
|
||||||
|
EmptyNs uint32 // don't c/r properties for namespace from this mask
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue