criu: restore into existing namespace when specified
criu: restore into existing namespace when specified

Using CRIU to checkpoint and restore a container into an existing
network namespace is not possible.

If the network namespace is defined like

	{
		"type": "network",
		"path": "/run/netns/test"
	}

there is the expectation that the restored container is again running in
the network namespace specified with 'path'.

This adds the new CRIU 'external namespace' feature to runc, where
during checkpointing that specific namespace is referenced and during
restore CRIU tries to restore the container in exactly that
namespace.

This breaks/fixes current runc behavior. If, without this patch, runc
restores a container with such a network namespace definition, it is
ignored and CRIU recreates a network namespace without a name.

With this patch runc uses the network namespace path (if available) to
checkpoint and restore the container in just that network namespace.

Restore will now fail if a container was checkpointed with a network
namespace path set and if that network namespace path does not exist
during restore.

runc still falls back to the old behavior if CRIU older than 3.11 is
installed.

Fixes #1786

Related to https://github.com/projectatomic/libpod/pull/469

Thanks to Andrei Vagin for all the help in getting the interface between
CRIU and runc right!

Signed-off-by: Adrian Reber <9f82b3db7475afbb412180fe9fab7c69d6ece340@redhat.com>

estesp/runc,dqminh/runc,mikebrow/runc,mYmNeo/runc,adrianreber/runc,laijs/runc,mYmNeo/runc,crosbymichael/runc,mikebrow/runc,rhatdan/runc,opencontainers/runc,crosbymichael/runc,justincormack/runc,laijs/runc,adrianreber/runc,justincormack/runc,rhatdan/runc,dqminh/runc,cyphar/runc,xiaochenshen/runc,kolyshkin/runc,kolyshkin/runc,xiaochenshen/runc,mheon/runc,dqminh/runc,dqminh/runc,estesp/runc,mikebrow/runc,xiaochenshen/runc,estesp/runc,kolyshkin/runc,laijs/runc,mYmNeo/runc,cyphar/runc,opencontainers/runc,mheon/runc,cyphar/runc,opencontainers/runc,kolyshkin/runc,adrianreber/runc,rhatdan/runc,crosbymichael/runc,opencontainers/runc,rhatdan/runc,mheon/runc,justincormack/runc