summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-06-07 14:33:20 +0200
committerGitHub <noreply@github.com>2019-06-07 14:33:20 +0200
commit346128792c9079d0092de4d84c16d63ce7df4515 (patch)
tree6048bf93558e5f7928cbb10690e3f88b3d975f5e /libpod/container_api.go
parentba36a5f4461abfa2a2818b756bda4d6e609f6de6 (diff)
parentbef83c42eaacd83fb5020395f1bbdeb9a6f0f220 (diff)
downloadpodman-346128792c9079d0092de4d84c16d63ce7df4515.tar.gz
podman-346128792c9079d0092de4d84c16d63ce7df4515.tar.bz2
podman-346128792c9079d0092de4d84c16d63ce7df4515.zip
Merge pull request #2272 from adrianreber/migration
Add support to migrate containers
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index eff5bfe5f..c27cb85ea 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -815,11 +815,27 @@ type ContainerCheckpointOptions struct {
// TCPEstablished tells the API to checkpoint a container
// even if it contains established TCP connections
TCPEstablished bool
+ // Export tells the API to write the checkpoint image to
+ // the filename set in TargetFile
+ // Import tells the API to read the checkpoint image from
+ // the filename set in TargetFile
+ TargetFile string
+ // Name tells the API that during restore from an exported
+ // checkpoint archive a new name should be used for the
+ // restored container
+ Name string
}
// Checkpoint checkpoints a container
func (c *Container) Checkpoint(ctx context.Context, options ContainerCheckpointOptions) error {
logrus.Debugf("Trying to checkpoint container %s", c.ID())
+
+ if options.TargetFile != "" {
+ if err := c.prepareCheckpointExport(); err != nil {
+ return err
+ }
+ }
+
if !c.batched {
c.lock.Lock()
defer c.lock.Unlock()