[CRIU] [crtools-bot] checkpoint: switch namespaces before collect stage

Cyrill Gorcunov gorcunov at openvz.org
Fri Feb 3 12:27:07 EST 2012


The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
--------------->
commit 6079c5092580605f9a06f2de0421f92acc6d33e5
Author: Stanislav Kinsbursky <skinsbursky at parallels.com>
Date:   Fri Feb 3 16:48:44 2012 +0300

    checkpoint: switch namespaces before collect stage
    
    Cleanup patch.
    
    Signed-off-by: Stanislav Kinsbursky <skinsbursky at parallels.com>
    Acked-by: Pavel Emelyanov <xemul at parallels.com>
    Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 ipc_ns.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/ipc_ns.c b/ipc_ns.c
index 0675586..e7cc8a8 100644
--- a/ipc_ns.c
+++ b/ipc_ns.c
@@ -102,15 +102,11 @@ static int collect_ipc_tun(struct ipc_ns_entry *e)
 	return ipc_sysctl_req(e, CTL_READ);
 }
 
-static int collect_ipc_data(int ns_pid, struct ipc_ns_data *ipc)
+static int collect_ipc_data(struct ipc_ns_data *ipc)
 {
 	int fd, ret;
 	struct ipc_ns_entry *entry = &ipc->entry;
 
-	ret = switch_ns(ns_pid, CLONE_NEWIPC, "ipc");
-	if (ret < 0)
-		return ret;
-
 	entry->in_use[IPC_MSG_IDS] = ret = collect_ipc_msg(NULL);
 	if (ret < 0)
 		return ret;
@@ -144,7 +140,11 @@ int dump_ipc_ns(int ns_pid, struct cr_fdset *fdset)
 	int fd, ret;
 	struct ipc_ns_data ipc;
 
-	ret = collect_ipc_data(ns_pid, &ipc);
+	ret = switch_ns(ns_pid, CLONE_NEWIPC, "ipc");
+	if (ret < 0)
+		return ret;
+
+	ret = collect_ipc_data(&ipc);
 	if (ret < 0) {
 		pr_err("Failed to collect IPC namespace data\n");
 		return ret;


More information about the CRIU mailing list