Commit 83e6d14e authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

cr-dump: split collect_dump_pstree to collect and dump

When we dump pid ns, dump_pstree is called after dump_tasks
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 772edd46
...@@ -1364,8 +1364,6 @@ static int collect_subtree(struct pstree_item *item, int leader_only) ...@@ -1364,8 +1364,6 @@ static int collect_subtree(struct pstree_item *item, int leader_only)
return 0; return 0;
} }
static int dump_pstree(struct pstree_item *item);
static int collect_pstree(pid_t pid, const struct cr_options *opts) static int collect_pstree(pid_t pid, const struct cr_options *opts)
{ {
int ret, attempts = 5; int ret, attempts = 5;
...@@ -1414,10 +1412,7 @@ try_again: ...@@ -1414,10 +1412,7 @@ try_again:
if (!ret) if (!ret)
ret = check_xids(root_item); ret = check_xids(root_item);
if (ret)
return ret; return ret;
return dump_pstree(root_item);
} }
static int dump_pstree(struct pstree_item *root_item) 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) ...@@ -1702,6 +1697,9 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
if (collect_pstree(pid, opts)) if (collect_pstree(pid, opts))
goto err; goto err;
if (dump_pstree(root_item))
goto err;
if (opts->namespaces_flags) { if (opts->namespaces_flags) {
if (dump_namespaces(pid, opts->namespaces_flags) < 0) if (dump_namespaces(pid, opts->namespaces_flags) < 0)
goto err; goto err;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment