[CRIU] [PATCH 10/11] namespace: add real pid to nsid

Andrey Vagin avagin at openvz.org
Mon Sep 30 06:16:52 PDT 2013


Before we dumped namespace of the root task only.
Now we are going to dump nested namespaces, so we need to know a pid of
any process, which lives in the target namespace.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 namespaces.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/namespaces.c b/namespaces.c
index 6bffa2a..fde76a1 100644
--- a/namespaces.c
+++ b/namespaces.c
@@ -113,6 +113,7 @@ int restore_ns(int rst, struct ns_desc *nd)
 struct ns_id {
 	unsigned int kid;
 	unsigned int id;
+	pid_t pid;
 	struct ns_desc *nd;
 	struct ns_id *next;
 };
@@ -161,6 +162,7 @@ static unsigned int generate_ns_id(int pid, unsigned int kid, struct ns_desc *nd
 	nsid->kid = kid;
 	nsid->nd = nd;
 	nsid->next = ns_ids;
+	nsid->pid = pid;
 	ns_ids = nsid;
 
 	pr_info("Collected %u.%s namespace\n", nsid->id, nd->str);
-- 
1.8.3.1



More information about the CRIU mailing list