From 46dd56ba07e2a8e63ae040c60896e888801c77a2 Mon Sep 17 00:00:00 2001 From: Hui Kang Date: Fri, 24 Apr 2015 15:13:15 +0000 Subject: [PATCH] Change back to --page-server, PageServer should be in CriOpts struct Docker-DCO-1.1-Signed-off-by: Hui Kang --- container_linux.go | 6 +++--- criu_opts.go | 14 +++++++------- nsinit/checkpoint.go | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/container_linux.go b/container_linux.go index 50bbd749..f07960e0 100644 --- a/container_linux.go +++ b/container_linux.go @@ -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), } } diff --git a/criu_opts.go b/criu_opts.go index ae6f51b3..9e9563e7 100644 --- a/criu_opts.go +++ b/criu_opts.go @@ -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 } diff --git a/nsinit/checkpoint.go b/nsinit/checkpoint.go index dc10e653..a68d3e68 100644 --- a/nsinit/checkpoint.go +++ b/nsinit/checkpoint.go @@ -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), }