summaryrefslogtreecommitdiff
path: root/libpod/container_internal_linux.go
diff options
context:
space:
mode:
authorAdrian Reber <areber@redhat.com>2021-06-10 12:27:09 +0000
committerAdrian Reber <adrian@lisas.de>2021-06-10 15:29:24 +0200
commit240bbc3bfa7d0dcab287186907b2bb350b8b370a (patch)
treedcdcbe2a599486a8dcd5c0c690137c51c7cdb23f /libpod/container_internal_linux.go
parentd116bebdd564745f6d0adcd996e3a251b6d8e0e5 (diff)
downloadpodman-240bbc3bfa7d0dcab287186907b2bb350b8b370a.tar.gz
podman-240bbc3bfa7d0dcab287186907b2bb350b8b370a.tar.bz2
podman-240bbc3bfa7d0dcab287186907b2bb350b8b370a.zip
Fix pre-checkpointing
Unfortunately --pre-checkpointing never worked as intended and recent changes to runc have shown that it is broken. To create a pre-checkpoint CRIU expects the paths between the pre-checkpoints to be a relative path. If having a previous checkpoint it needs the be referenced like this: --prev-images-dir ../parent Unfortunately Podman was giving runc (and CRIU) an absolute path. Unfortunately, again, until March 2021 CRIU silently ignored if the path was not relative and switch back to normal checkpointing. This has been now fixed in CRIU and runc and running pre-checkpoint with the latest runc fails, because runc already sees that the path is absolute and returns an error. This commit fixes this by giving runc a relative path. This commit also fixes a second pre-checkpointing error which was just recently introduced. So summarizing: pre-checkpointing never worked correctly because CRIU ignored wrong parameters and recent changes broke it even more. Now both errors should be fixed. [NO TESTS NEEDED] Signed-off-by: Adrian Reber <areber@redhat.com> Signed-off-by: Adrian Reber <adrian@lisas.de>
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r--libpod/container_internal_linux.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go
index 94bf7855b..ddfccb999 100644
--- a/libpod/container_internal_linux.go
+++ b/libpod/container_internal_linux.go
@@ -909,14 +909,15 @@ func (c *Container) exportCheckpoint(options ContainerCheckpointOptions) error {
includeFiles := []string{
"artifacts",
"ctr.log",
- metadata.CheckpointDirectory,
metadata.ConfigDumpFile,
metadata.SpecDumpFile,
metadata.NetworkStatusFile,
}
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
var addToTarFiles []string