2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

IPC: dump namespace itself

Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
This commit is contained in:
Stanislav Kinsbursky
2012-01-31 22:28:55 +04:00
committed by Cyrill Gorcunov
parent 9cdfe71921
commit c826057a9c
7 changed files with 322 additions and 3 deletions

View File

@@ -4,6 +4,7 @@
#include "util.h"
#include "syscall.h"
#include "uts_ns.h"
#include "ipc_ns.h"
int switch_ns(int pid, int type, char *ns)
{
@@ -35,8 +36,17 @@ static int do_dump_namespaces(int ns_pid, unsigned int ns_flags)
if (fdset == NULL)
return -1;
ret = dump_uts_ns(ns_pid, fdset);
if (ns_flags & CLONE_NEWUTS) {
ret = dump_uts_ns(ns_pid, fdset);
if (ret < 0)
goto err;
}
if (ns_flags & CLONE_NEWIPC) {
ret = dump_ipc_ns(ns_pid, fdset);
if (ret < 0)
goto err;
}
err:
close_cr_fdset(&fdset);
return ret;