Change back to --page-server, PageServer should be in CriOpts struct
Docker-DCO-1.1-Signed-off-by: Hui Kang <hkang.sunysb@gmail.com>
This commit is contained in:
parent
1d89a25aec
commit
46dd56ba07
|
@ -341,10 +341,10 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// append optional criu opts, e.g., page-server and port
|
// append optional criu opts, e.g., page-server and port
|
||||||
if criuOpts.Ps.Address != "" && criuOpts.Ps.Port != 0 {
|
if criuOpts.PageServer.Address != "" && criuOpts.PageServer.Port != 0 {
|
||||||
rpcOpts.Ps = &criurpc.CriuPageServerInfo{
|
rpcOpts.Ps = &criurpc.CriuPageServerInfo{
|
||||||
Address: proto.String(criuOpts.Ps.Address),
|
Address: proto.String(criuOpts.PageServer.Address),
|
||||||
Port: proto.Int32(criuOpts.Ps.Port),
|
Port: proto.Int32(criuOpts.PageServer.Port),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
criu_opts.go
14
criu_opts.go
|
@ -6,11 +6,11 @@ type CriuPageServerInfo struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type CriuOpts struct {
|
type CriuOpts struct {
|
||||||
ImagesDirectory string // directory for storing image files
|
ImagesDirectory string // directory for storing image files
|
||||||
WorkDirectory string // directory to cd and write logs/pidfiles/stats to
|
WorkDirectory string // directory to cd and write logs/pidfiles/stats to
|
||||||
LeaveRunning bool // leave container in running state after checkpoint
|
LeaveRunning bool // leave container in running state after checkpoint
|
||||||
TcpEstablished bool // checkpoint/restore established TCP connections
|
TcpEstablished bool // checkpoint/restore established TCP connections
|
||||||
ExternalUnixConnections bool // allow external unix connections
|
ExternalUnixConnections bool // allow external unix connections
|
||||||
ShellJob bool // allow to dump and restore shell jobs
|
ShellJob bool // allow to dump and restore shell jobs
|
||||||
Ps CriuPageServerInfo // allow to dump to criu page server
|
PageServer CriuPageServerInfo // allow to dump to criu page server
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ var checkpointCommand = cli.Command{
|
||||||
cli.BoolFlag{Name: "tcp-established", Usage: "allow open tcp connections"},
|
cli.BoolFlag{Name: "tcp-established", Usage: "allow open tcp connections"},
|
||||||
cli.BoolFlag{Name: "ext-unix-sk", Usage: "allow external unix sockets"},
|
cli.BoolFlag{Name: "ext-unix-sk", Usage: "allow external unix sockets"},
|
||||||
cli.BoolFlag{Name: "shell-job", Usage: "allow shell jobs"},
|
cli.BoolFlag{Name: "shell-job", Usage: "allow shell jobs"},
|
||||||
cli.StringFlag{Name: "PageServer", Value: "", Usage: "ADDRESS:PORT of the page server"},
|
cli.StringFlag{Name: "page-server", Value: "", Usage: "ADDRESS:PORT of the page server"},
|
||||||
},
|
},
|
||||||
Action: func(context *cli.Context) {
|
Action: func(context *cli.Context) {
|
||||||
imagePath := context.String("image-path")
|
imagePath := context.String("image-path")
|
||||||
|
@ -44,17 +44,17 @@ var checkpointCommand = cli.Command{
|
||||||
|
|
||||||
// xxx following criu opts are optional
|
// xxx following criu opts are optional
|
||||||
// The dump image can be sent to a criu page server
|
// The dump image can be sent to a criu page server
|
||||||
if psOpt := context.String("PageServer"); psOpt != "" {
|
if psOpt := context.String("page-server"); psOpt != "" {
|
||||||
addressPort := strings.Split(psOpt, ":")
|
addressPort := strings.Split(psOpt, ":")
|
||||||
if len(addressPort) != 2 {
|
if len(addressPort) != 2 {
|
||||||
fatal(fmt.Errorf("Use --PageServer ADDRESS:PORT to specify page server"))
|
fatal(fmt.Errorf("Use --page-server ADDRESS:PORT to specify page server"))
|
||||||
}
|
}
|
||||||
|
|
||||||
port_int, err := strconv.Atoi(addressPort[1])
|
port_int, err := strconv.Atoi(addressPort[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fatal(fmt.Errorf("Invalid port number"))
|
fatal(fmt.Errorf("Invalid port number"))
|
||||||
}
|
}
|
||||||
criuOpts.Ps = libcontainer.CriuPageServerInfo{
|
criuOpts.PageServer = libcontainer.CriuPageServerInfo{
|
||||||
Address: addressPort[0],
|
Address: addressPort[0],
|
||||||
Port: int32(port_int),
|
Port: int32(port_int),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue