summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-11-28 07:00:24 -0800
committerGitHub <noreply@github.com>2018-11-28 07:00:24 -0800
commiteffd63d6d5c2541f09745261a1e9205fa531e526 (patch)
tree2f7a3f956fdc1dfcb0743da87fbec4abb02662a6 /libpod/container_api.go
parentd346996e1512ef6efb3800d6cb762d0409d12459 (diff)
parentd3cde7cefe4eed4b8cb0723211c19352c55f3dcf (diff)
downloadpodman-effd63d6d5c2541f09745261a1e9205fa531e526.tar.gz
podman-effd63d6d5c2541f09745261a1e9205fa531e526.tar.bz2
podman-effd63d6d5c2541f09745261a1e9205fa531e526.zip
Merge pull request #1848 from adrianreber/master
Add tcp-established to checkpoint/restore
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go14
1 files changed, 10 insertions, 4 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index e1d5e15c4..4789c0cd2 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -833,10 +833,16 @@ func (c *Container) Refresh(ctx context.Context) error {
}
// ContainerCheckpointOptions is a struct used to pass the parameters
-// for checkpointing to corresponding functions
+// for checkpointing (and restoring) to the corresponding functions
type ContainerCheckpointOptions struct {
- Keep bool
+ // Keep tells the API to not delete checkpoint artifacts
+ Keep bool
+ // KeepRunning tells the API to keep the container running
+ // after writing the checkpoint to disk
KeepRunning bool
+ // TCPEstablished tells the API to checkpoint a container
+ // even if it contains established TCP connections
+ TCPEstablished bool
}
// Checkpoint checkpoints a container
@@ -855,7 +861,7 @@ func (c *Container) Checkpoint(ctx context.Context, options ContainerCheckpointO
}
// Restore restores a container
-func (c *Container) Restore(ctx context.Context, keep bool) (err error) {
+func (c *Container) Restore(ctx context.Context, options ContainerCheckpointOptions) (err error) {
logrus.Debugf("Trying to restore container %s", c)
if !c.batched {
c.lock.Lock()
@@ -866,5 +872,5 @@ func (c *Container) Restore(ctx context.Context, keep bool) (err error) {
}
}
- return c.restore(ctx, keep)
+ return c.restore(ctx, options)
}