[CRIU] [PATCH 2/2] pstree: Relax pstree_insert_pid

Pavel Emelyanov xemul at virtuozzo.com
Fri Feb 10 03:29:15 PST 2017


Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/cr-dump.c        | 4 ++--
 criu/include/pstree.h | 2 +-
 criu/pstree.c         | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index 022e7db..ab203b0 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -836,7 +836,7 @@ static int dump_task_thread(struct parasite_ctl *parasite_ctl,
 		pr_err("Can't dump thread for pid %d\n", pid);
 		goto err;
 	}
-	pstree_insert_pid(tid->ns[0].virt, tid);
+	pstree_insert_pid(tid);
 
 	img = open_image(CR_FD_CORE, O_DUMP, tid->ns[0].virt);
 	if (!img)
@@ -1297,7 +1297,7 @@ static int dump_one_task(struct pstree_item *item)
 	}
 
 	item->pid->ns[0].virt = misc.pid;
-	pstree_insert_pid(vpid(item), item->pid);
+	pstree_insert_pid(item->pid);
 	item->sid = misc.sid;
 	item->pgid = misc.pgid;
 
diff --git a/criu/include/pstree.h b/criu/include/pstree.h
index 3e869de..b082e35 100644
--- a/criu/include/pstree.h
+++ b/criu/include/pstree.h
@@ -90,7 +90,7 @@ extern struct pstree_item *__alloc_pstree_item(bool rst);
 extern void init_pstree_helper(struct pstree_item *ret);
 
 extern struct pstree_item *lookup_create_item(pid_t pid);
-extern void pstree_insert_pid(pid_t pid, struct pid *pid_node);
+extern void pstree_insert_pid(struct pid *pid_node);
 extern struct pid *pstree_pid_by_virt(pid_t pid);
 
 extern struct pstree_item *root_item;
diff --git a/criu/pstree.c b/criu/pstree.c
index 5b6d3aa..ad1a370 100644
--- a/criu/pstree.c
+++ b/criu/pstree.c
@@ -416,11 +416,11 @@ static struct pid *lookup_create_pid(pid_t pid, struct pid *pid_node)
 	return pid_node;
 }
 
-void pstree_insert_pid(pid_t pid, struct pid *pid_node)
+void pstree_insert_pid(struct pid *pid_node)
 {
 	struct pid* n;
 
-	n = lookup_create_pid(pid, pid_node);
+	n = lookup_create_pid(pid_node->ns[0].virt, pid_node);
 
 	BUG_ON(n != pid_node);
 }
-- 
2.5.0



More information about the CRIU mailing list