mirror of
https://github.com/containers/podman.git
synced 2025-06-26 12:56:45 +08:00
Merge pull request #10639 from adrianreber/2021-06-10-pre-dump-fix
Fix pre-checkpointing
This commit is contained in:
@ -42,6 +42,7 @@ const (
|
|||||||
// name of the directory holding the artifacts
|
// name of the directory holding the artifacts
|
||||||
artifactsDir = "artifacts"
|
artifactsDir = "artifacts"
|
||||||
execDirPermission = 0755
|
execDirPermission = 0755
|
||||||
|
preCheckpointDir = "pre-checkpoint"
|
||||||
)
|
)
|
||||||
|
|
||||||
// rootFsSize gets the size of the container's root filesystem
|
// rootFsSize gets the size of the container's root filesystem
|
||||||
@ -141,7 +142,7 @@ func (c *Container) CheckpointPath() string {
|
|||||||
|
|
||||||
// PreCheckpointPath returns the path to the directory containing the pre-checkpoint-images
|
// PreCheckpointPath returns the path to the directory containing the pre-checkpoint-images
|
||||||
func (c *Container) PreCheckPointPath() string {
|
func (c *Container) PreCheckPointPath() string {
|
||||||
return filepath.Join(c.bundlePath(), "pre-checkpoint")
|
return filepath.Join(c.bundlePath(), preCheckpointDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AttachSocketPath retrieves the path of the container's attach socket
|
// AttachSocketPath retrieves the path of the container's attach socket
|
||||||
|
@ -909,14 +909,15 @@ func (c *Container) exportCheckpoint(options ContainerCheckpointOptions) error {
|
|||||||
includeFiles := []string{
|
includeFiles := []string{
|
||||||
"artifacts",
|
"artifacts",
|
||||||
"ctr.log",
|
"ctr.log",
|
||||||
metadata.CheckpointDirectory,
|
|
||||||
metadata.ConfigDumpFile,
|
metadata.ConfigDumpFile,
|
||||||
metadata.SpecDumpFile,
|
metadata.SpecDumpFile,
|
||||||
metadata.NetworkStatusFile,
|
metadata.NetworkStatusFile,
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.PreCheckPoint {
|
if options.PreCheckPoint {
|
||||||
includeFiles[0] = "pre-checkpoint"
|
includeFiles = append(includeFiles, preCheckpointDir)
|
||||||
|
} else {
|
||||||
|
includeFiles = append(includeFiles, metadata.CheckpointDirectory)
|
||||||
}
|
}
|
||||||
// Get root file-system changes included in the checkpoint archive
|
// Get root file-system changes included in the checkpoint archive
|
||||||
var addToTarFiles []string
|
var addToTarFiles []string
|
||||||
|
@ -787,7 +787,11 @@ func (r *ConmonOCIRuntime) CheckpointContainer(ctr *Container, options Container
|
|||||||
args = append(args, "--pre-dump")
|
args = append(args, "--pre-dump")
|
||||||
}
|
}
|
||||||
if !options.PreCheckPoint && options.WithPrevious {
|
if !options.PreCheckPoint && options.WithPrevious {
|
||||||
args = append(args, "--parent-path", ctr.PreCheckPointPath())
|
args = append(
|
||||||
|
args,
|
||||||
|
"--parent-path",
|
||||||
|
filepath.Join("..", preCheckpointDir),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
runtimeDir, err := util.GetRuntimeDir()
|
runtimeDir, err := util.GetRuntimeDir()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user