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

parasite: Precreate daemon control sockets

Now we have netns on pstree-item and have the place
where to pre-create daemon socket in needed namespace.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2014-09-29 22:05:43 +04:00
parent 80efa564f4
commit 45fd143409
2 changed files with 14 additions and 18 deletions

8
net.c
View File

@@ -652,6 +652,12 @@ static int prep_ns_sockets(struct ns_id *ns)
goto err_nl;
}
ret = ns->net.seqsk = socket(PF_UNIX, SOCK_SEQPACKET, 0);
if (ret < 0) {
pr_perror("Can't create seqsk for parasite");
goto err_sq;
}
ret = 0;
out:
if (nsret >= 0 && restore_ns(nsret, &net_ns_desc) < 0) {
@@ -663,6 +669,8 @@ out:
return ret;
err_ret:
close(ns->net.seqsk);
err_sq:
close(ns->net.nlsk);
err_nl:
goto out;