mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
crtools: dump pstree to image file without pid number
Pid number is redundant - this file is one for the whole tree. Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
f659f64247
commit
b82edc9fdf
@@ -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;
|
||||
|
||||
|
12
cr-show.c
12
cr-show.c
@@ -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"
|
||||
|
Reference in New Issue
Block a user