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:
6
net.c
6
net.c
@@ -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",
|
||||
};
|
||||
|
Reference in New Issue
Block a user