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:
committed by
Pavel Emelyanov
parent
57b1e94522
commit
9b3b059bdc
@@ -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");
|
||||
|
Reference in New Issue
Block a user