[CRIU] [PATCH v4 24/41] pid: Add fdstore id for pid_ns descriptor

Kirill Tkhai ktkhai at virtuozzo.com
Thu May 4 09:09:05 PDT 2017


Field to keep fdstore id of open pid_ns descriptor.

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

diff --git a/criu/include/namespaces.h b/criu/include/namespaces.h
index 87eabfb7b..b126bed2c 100644
--- a/criu/include/namespaces.h
+++ b/criu/include/namespaces.h
@@ -152,6 +152,7 @@ struct ns_id {
 		} user;
 		struct {
 			struct rb_root rb_root;
+			int nsfd_id;
 		} pid;
 	};
 };
diff --git a/criu/namespaces.c b/criu/namespaces.c
index 96f989c8e..11b33a0e1 100644
--- a/criu/namespaces.c
+++ b/criu/namespaces.c
@@ -310,8 +310,10 @@ struct ns_id *rst_new_ns_id(unsigned int id, pid_t pid,
 			INIT_LIST_HEAD(&nsid->net.ids);
 			INIT_LIST_HEAD(&nsid->net.links);
 			nsid->net.netns = NULL;
-		} else if (nd == &pid_ns_desc)
+		} else if (nd == &pid_ns_desc) {
 			nsid->pid.rb_root = RB_ROOT;
+			nsid->pid.nsfd_id = -1;
+		}
 	}
 
 	return nsid;



More information about the CRIU mailing list