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

ns: Introduce ns descriptors

These are structs that (now) tie together ns string
and the CLONE_ flag. It's nice to have one (some code
becomes simpler) and will help us with auto-namespaces
detection.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2013-01-15 23:24:01 +04:00
parent eb8f8c12cd
commit 3a1c7d1d76
12 changed files with 60 additions and 18 deletions

6
net.c
View File

@@ -339,7 +339,7 @@ int dump_net_ns(int pid, struct cr_fdset *fds)
{
int ret;
ret = switch_ns(pid, CLONE_NEWNET, "net", NULL);
ret = switch_ns(pid, &net_ns_desc, NULL);
if (!ret)
ret = dump_links(fds);
if (!ret)
@@ -402,3 +402,7 @@ void network_unlock(void)
run_scripts("network-unlock");
}
struct ns_desc net_ns_desc = {
.cflag = CLONE_NEWNET,
.str = "net",
};