[CRIU] [PATCH v5 10/31] ns: Add user and pid ns_id on restore

Kirill Tkhai ktkhai at virtuozzo.com
Thu Feb 23 07:14:00 PST 2017


Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/include/namespaces.h |    1 +
 criu/pstree.c             |    8 ++++++++
 2 files changed, 9 insertions(+)

diff --git a/criu/include/namespaces.h b/criu/include/namespaces.h
index 0a8002ea6..988c3c0b8 100644
--- a/criu/include/namespaces.h
+++ b/criu/include/namespaces.h
@@ -135,6 +135,7 @@ extern unsigned int child_userns_xid(unsigned int xid, UidGidExtent **map, int n
 
 extern struct ns_desc pid_ns_desc;
 extern struct ns_desc user_ns_desc;
+extern struct ns_desc net_ns_desc;
 extern unsigned long root_ns_mask;
 
 extern const struct fdtype_ops nsfile_dump_ops;
diff --git a/criu/pstree.c b/criu/pstree.c
index 7812c29d6..8a8b00e4f 100644
--- a/criu/pstree.c
+++ b/criu/pstree.c
@@ -480,6 +480,14 @@ static int read_pstree_ids(struct pstree_item *pi)
 		if (rst_add_ns_id(pi->ids->net_ns_id, pi, &net_ns_desc))
 			return -1;
 	}
+	if (pi->ids->has_user_ns_id) {
+		if (rst_add_ns_id(pi->ids->user_ns_id, pi, &user_ns_desc))
+			return -1;
+	}
+	if (pi->ids->has_pid_ns_id) {
+		if (rst_add_ns_id(pi->ids->pid_ns_id, pi, &pid_ns_desc))
+			return -1;
+	}
 
 	return 0;
 }



More information about the CRIU mailing list