Commit b82edc9f authored by Stanislav Kinsbursky's avatar Stanislav Kinsbursky Committed by Pavel Emelyanov

crtools: dump pstree to image file without pid number

Pid number is redundant - this file is one for the whole tree.
Signed-off-by: 's avatarStanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f659f642
......@@ -1151,7 +1151,7 @@ static int dump_pstree(pid_t pid, const struct list_head *pstree_list)
pr_info("Dumping pstree (pid: %d)\n", pid);
pr_info("----------------------------------------\n");
pstree_fd = open_image(CR_FD_PSTREE, O_RDWR | O_CREAT | O_EXCL, pid);
pstree_fd = open_image(CR_FD_PSTREE, O_RDWR | O_CREAT | O_EXCL);
if (pstree_fd < 0)
return -1;
......
......@@ -1167,7 +1167,7 @@ static int restore_task_with_children(void *_arg)
pr_info("%d: Starting restore\n", me->pid);
fd = open_image_ro_nocheck(FMT_FNAME_PSTREE, pstree_pid);
fd = open_image_ro_nocheck(FMT_FNAME_PSTREE);
if (fd < 0) {
pr_perror("%d: Can't reopen pstree image", me->pid);
exit(1);
......@@ -1291,7 +1291,7 @@ static int restore_all_tasks(pid_t pid, struct cr_options *opts)
int pstree_fd = -1;
u32 type = 0;
pstree_fd = open_image_ro(CR_FD_PSTREE, pstree_pid);
pstree_fd = open_image_ro(CR_FD_PSTREE);
if (pstree_fd < 0)
return -1;
......
......@@ -561,16 +561,20 @@ static int cr_show_all(unsigned long pid, struct cr_options *opts)
struct cr_fdset *cr_fdset = NULL;
struct pstree_item *item = NULL;
LIST_HEAD(pstree_list);
int i, ret = -1;
int i, ret = -1, pstree_fd;
cr_fdset = cr_show_fdset_open(pid, CR_FD_DESC_PSTREE | CR_FD_DESC_SK_QUEUES);
if (!cr_fdset)
pstree_fd = open_image_ro(CR_FD_PSTREE);
if (pstree_fd)
goto out;
ret = show_pstree(cr_fdset->fds[CR_FD_PSTREE], &pstree_list);
ret = show_pstree(pstree_fd, &pstree_list);
if (ret)
goto out;
cr_fdset = cr_show_fdset_open(pid, CR_FD_DESC_SK_QUEUES);
if (!cr_fdset)
goto out;
ret = show_sk_queues(cr_fdset->fds[CR_FD_SK_QUEUES]);
if (ret)
goto out;
......
......@@ -83,7 +83,7 @@ extern struct cr_fd_desc_tmpl fdset_template[CR_FD_MAX];
#define FMT_FNAME_CORE "core-%d.img"
#define FMT_FNAME_VMAS "vmas-%d.img"
#define FMT_FNAME_PIPES "pipes-%d.img"
#define FMT_FNAME_PSTREE "pstree-%d.img"
#define FMT_FNAME_PSTREE "pstree.img"
#define FMT_FNAME_SIGACTS "sigacts-%d.img"
#define FMT_FNAME_UNIXSK "unixsk-%d.img"
#define FMT_FNAME_INETSK "inetsk-%d.img"
......
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