criu_opts_unix.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // +build linux freebsd
  2. package libcontainer
  3. // cgroup restoring strategy provided by criu
  4. type cg_mode uint32
  5. const (
  6. CRIU_CG_MODE_SOFT cg_mode = 3 + iota // restore cgroup properties if only dir created by criu
  7. CRIU_CG_MODE_FULL // always restore all cgroups and their properties
  8. CRIU_CG_MODE_STRICT // restore all, requiring them to not present in the system
  9. CRIU_CG_MODE_DEFAULT // the same as CRIU_CG_MODE_SOFT
  10. )
  11. type CriuPageServerInfo struct {
  12. Address string // IP address of CRIU page server
  13. Port int32 // port number of CRIU page server
  14. }
  15. type VethPairName struct {
  16. ContainerInterfaceName string
  17. HostInterfaceName string
  18. }
  19. type CriuOpts struct {
  20. ImagesDirectory string // directory for storing image files
  21. WorkDirectory string // directory to cd and write logs/pidfiles/stats to
  22. LeaveRunning bool // leave container in running state after checkpoint
  23. TcpEstablished bool // checkpoint/restore established TCP connections
  24. ExternalUnixConnections bool // allow external unix connections
  25. ShellJob bool // allow to dump and restore shell jobs
  26. FileLocks bool // handle file locks, for safety
  27. PageServer CriuPageServerInfo // allow to dump to criu page server
  28. VethPairs []VethPairName // pass the veth to criu when restore
  29. ManageCgroupsMode cg_mode // dump or restore cgroup mode
  30. EmptyNs uint32 // don't c/r properties for namespace from this mask
  31. }