From 87712d288e420f6b421519bd799258b2037ff7d0 Mon Sep 17 00:00:00 2001 From: Adrian Reber Date: Tue, 17 Mar 2020 17:17:07 +0000 Subject: [PATCH] checkpoint: remove error message with --leave-running If checkpointing a container with '--leave-running' runc started to print the following message: ERRO[0000] container is not destroyed The message is correct, because CRIU did not terminate the process, but as that was requested by the user the message is wrong. So now the container is only destroyed if the user did not specify '--leave-running'. Signed-off-by: Adrian Reber --- checkpoint.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/checkpoint.go b/checkpoint.go index ae01ea3c..b0ddffde 100644 --- a/checkpoint.go +++ b/checkpoint.go @@ -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)