diff options
author | unknown <chen_zhuohan@163.com> | 2021-01-10 18:12:12 +0800 |
---|---|---|
committer | unknown <chen_zhuohan@163.com> | 2021-01-10 21:38:28 +0800 |
commit | 2aa381f2d0cdc8abb28aa8759c681198cb1e47a7 (patch) | |
tree | 3788c56606e3396d00d91b44f0eeba2d92542221 /libpod/container_api.go | |
parent | 49db79e735acd2c693762eaff62680cd9a8cb60b (diff) | |
download | podman-2aa381f2d0cdc8abb28aa8759c681198cb1e47a7.tar.gz podman-2aa381f2d0cdc8abb28aa8759c681198cb1e47a7.tar.bz2 podman-2aa381f2d0cdc8abb28aa8759c681198cb1e47a7.zip |
add pre checkpoint
Signed-off-by: Zhuohan Chen <chen_zhuohan@163.com>
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r-- | libpod/container_api.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go index 2c7dc79c9..87ff764e3 100644 --- a/libpod/container_api.go +++ b/libpod/container_api.go @@ -706,6 +706,13 @@ type ContainerCheckpointOptions struct { // IgnoreVolumes tells the API to not export or not to import // the content of volumes associated with the container IgnoreVolumes bool + // Pre Checkpoint container and leave container running + PreCheckPoint bool + // Dump container with Pre Checkpoint images + WithPrevious bool + // ImportPrevious tells the API to restore container with two + // images. One is TargetFile, the other is ImportPrevious. + ImportPrevious string } // Checkpoint checkpoints a container @@ -718,6 +725,12 @@ func (c *Container) Checkpoint(ctx context.Context, options ContainerCheckpointO } } + if options.WithPrevious { + if err := c.canWithPrevious(); err != nil { + return err + } + } + if !c.batched { c.lock.Lock() defer c.lock.Unlock() |