2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

crtools: add "pid" to the --namespaces cmdline option arguments (v3)

to require dumping pid namespace. Dump and restore will be failed if
a tress doesn't contain a process init.

pid namespace will be created implicitly if a process init in the tree.

v2: fix comments from Pavel
v3: Restore of pidns should be approved by user

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2012-06-22 00:38:00 +04:00
committed by Pavel Emelyanov
parent 57b1e94522
commit 9b3b059bdc
5 changed files with 24 additions and 9 deletions

View File

@@ -82,6 +82,11 @@ int dump_namespaces(struct pid *ns_pid, unsigned int ns_flags)
pr_info("Dumping %d(%d)'s namespaces\n", ns_pid->pid, ns_pid->real_pid);
if ((opts.namespaces_flags & CLONE_NEWPID) && ns_pid->pid != 1) {
pr_err("Can't dump a pid namespace without the process init\n");
return -1;
}
pid = fork();
if (pid < 0) {
pr_perror("Can't fork ns dumper");