[CRIU] [PATCH cr 03/13] cr-dump: split collect_dump_pstree to collect and dump

Andrey Vagin avagin at openvz.org
Tue Jun 19 07:53:07 EDT 2012


When we dump pid ns, dump_pstree is called after dump_tasks

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-dump.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/cr-dump.c b/cr-dump.c
index 2bebe95..e5770ab 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -1364,8 +1364,6 @@ static int collect_subtree(struct pstree_item *item, int leader_only)
 	return 0;
 }
 
-static int dump_pstree(struct pstree_item *item);
-
 static int collect_pstree(pid_t pid, const struct cr_options *opts)
 {
 	int ret, attempts = 5;
@@ -1414,10 +1412,7 @@ try_again:
 	if (!ret)
 		ret = check_xids(root_item);
 
-	if (ret)
-		return ret;
-
-	return dump_pstree(root_item);
+	return ret;
 }
 
 static int dump_pstree(struct pstree_item *root_item)
@@ -1702,6 +1697,9 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
 	if (collect_pstree(pid, opts))
 		goto err;
 
+	if (dump_pstree(root_item))
+		goto err;
+
 	if (opts->namespaces_flags) {
 		if (dump_namespaces(pid, opts->namespaces_flags) < 0)
 			goto err;
-- 
1.7.1



More information about the CRIU mailing list