Merge pull request #2260 from adrianreber/leave-running

checkpoint: remove error message with --leave-running
This commit is contained in:
Mrunal Patel 2020-03-24 14:18:39 -07:00 committed by GitHub
commit a7ee31fa18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -62,8 +62,15 @@ checkpointed.`,
if status == libcontainer.Created || status == libcontainer.Stopped {
fatalf("Container cannot be checkpointed in %s state", status.String())
}
defer destroy(container)
options := criuOptions(context)
if !options.LeaveRunning || !options.PreDump {
// destroy prints out an error if we tell CRIU to
// leave the container running:
// ERRO[0000] container is not destroyed
// The message is correct, but we actually do not want
// to destroy the container in this case.
defer destroy(container)
}
// these are the mandatory criu options for a container
setPageServer(context, options)
setManageCgroupsMode(context, options)