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:
Hui Kang 2015-04-24 15:13:15 +00:00 committed by Michael Crosby
parent 1d89a25aec
commit 46dd56ba07
3 changed files with 14 additions and 14 deletions

View File

@ -341,10 +341,10 @@ func (c *linuxContainer) Checkpoint(criuOpts *CriuOpts) error {
}
// 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{
Address: proto.String(criuOpts.Ps.Address),
Port: proto.Int32(criuOpts.Ps.Port),
Address: proto.String(criuOpts.PageServer.Address),
Port: proto.Int32(criuOpts.PageServer.Port),
}
}

View File

@ -6,11 +6,11 @@ type CriuPageServerInfo struct {
}
type CriuOpts struct {
ImagesDirectory string // directory for storing image files
WorkDirectory string // directory to cd and write logs/pidfiles/stats to
LeaveRunning bool // leave container in running state after checkpoint
TcpEstablished bool // checkpoint/restore established TCP connections
ExternalUnixConnections bool // allow external unix connections
ShellJob bool // allow to dump and restore shell jobs
Ps CriuPageServerInfo // allow to dump to criu page server
ImagesDirectory string // directory for storing image files
WorkDirectory string // directory to cd and write logs/pidfiles/stats to
LeaveRunning bool // leave container in running state after checkpoint
TcpEstablished bool // checkpoint/restore established TCP connections
ExternalUnixConnections bool // allow external unix connections
ShellJob bool // allow to dump and restore shell jobs
PageServer CriuPageServerInfo // allow to dump to criu page server
}

View File

@ -19,7 +19,7 @@ var checkpointCommand = cli.Command{
cli.BoolFlag{Name: "tcp-established", Usage: "allow open tcp connections"},
cli.BoolFlag{Name: "ext-unix-sk", Usage: "allow external unix sockets"},
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) {
imagePath := context.String("image-path")
@ -44,17 +44,17 @@ var checkpointCommand = cli.Command{
// xxx following criu opts are optional
// 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, ":")
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])
if err != nil {
fatal(fmt.Errorf("Invalid port number"))
}
criuOpts.Ps = libcontainer.CriuPageServerInfo{
criuOpts.PageServer = libcontainer.CriuPageServerInfo{
Address: addressPort[0],
Port: int32(port_int),
}