summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorunknown <chen_zhuohan@163.com>2021-01-10 18:12:12 +0800
committerunknown <chen_zhuohan@163.com>2021-01-10 21:38:28 +0800
commit2aa381f2d0cdc8abb28aa8759c681198cb1e47a7 (patch)
tree3788c56606e3396d00d91b44f0eeba2d92542221 /libpod/container_internal.go
parent49db79e735acd2c693762eaff62680cd9a8cb60b (diff)
downloadpodman-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_internal.go')
-rw-r--r--libpod/container_internal.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 540230c26..c7548e0e5 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -134,6 +134,11 @@ func (c *Container) CheckpointPath() string {
return filepath.Join(c.bundlePath(), "checkpoint")
}
+// PreCheckpointPath returns the path to the directory containing the pre-checkpoint-images
+func (c *Container) PreCheckPointPath() string {
+ return filepath.Join(c.bundlePath(), "pre-checkpoint")
+}
+
// AttachSocketPath retrieves the path of the container's attach socket
func (c *Container) AttachSocketPath() (string, error) {
return c.ociRuntime.AttachSocketPath(c)
@@ -2023,6 +2028,12 @@ func (c *Container) checkReadyForRemoval() error {
return nil
}
+// canWithPrevious return the stat of the preCheckPoint dir
+func (c *Container) canWithPrevious() error {
+ _, err := os.Stat(c.PreCheckPointPath())
+ return err
+}
+
// writeJSONFile marshalls and writes the given data to a JSON file
// in the bundle path
func (c *Container) writeJSONFile(v interface{}, file string) error {