From c3675196c951c5cab7fb57bc348d93658550d260 Mon Sep 17 00:00:00 2001 From: "yangzhao.hjh" Date: Wed, 9 Oct 2024 19:01:55 +0800 Subject: [PATCH] Terminate execution for criu that does not meet version requirements Signed-off-by: yangzhao.hjh --- libcontainer/criu_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcontainer/criu_linux.go b/libcontainer/criu_linux.go index 4c6ae71465f..fed34e79148 100644 --- a/libcontainer/criu_linux.go +++ b/libcontainer/criu_linux.go @@ -186,7 +186,7 @@ func criuNsToKey(t configs.NamespaceType) string { func (c *Container) handleCheckpointingExternalNamespaces(rpcOpts *criurpc.CriuOpts, t configs.NamespaceType) error { if !c.criuSupportsExtNS(t) { - return nil + return fmt.Errorf("criu lacks support for external %s namespace during checkpointing process (old criu version?)", configs.NsName(t)) } nsPath := c.config.Namespaces.PathOf(t) @@ -246,7 +246,7 @@ func (c *Container) handleRestoringNamespaces(rpcOpts *criurpc.CriuOpts, extraFi func (c *Container) handleRestoringExternalNamespaces(rpcOpts *criurpc.CriuOpts, extraFiles *[]*os.File, t configs.NamespaceType) error { if !c.criuSupportsExtNS(t) { - return nil + return fmt.Errorf("criu lacks support for external %s namespace during the restoration process (old criu version?)", configs.NsName(t)) } nsPath := c.config.Namespaces.PathOf(t)