mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
dump: dump pstree outside tasks loop
No need in checking the pid in every task loop cycle, just dump it at the beginning and that's it. 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
adce8197c4
commit
8b7497a5ef
14
cr-dump.c
14
cr-dump.c
@@ -1433,18 +1433,18 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
|
||||
|
||||
collect_sockets();
|
||||
|
||||
cr_fdset = cr_dump_fdset_open(pid, CR_FD_DESC_USE(CR_FD_PSTREE), cr_fdset);
|
||||
if (!cr_fdset)
|
||||
goto err;
|
||||
if (dump_pstree(pid, &pstree_list, cr_fdset))
|
||||
goto err;
|
||||
close_cr_fdset(&cr_fdset);
|
||||
|
||||
list_for_each_entry(item, &pstree_list, list) {
|
||||
cr_fdset = cr_dump_fdset_open(item->pid, CR_FD_DESC_NONE, NULL);
|
||||
if (!cr_fdset)
|
||||
goto err;
|
||||
|
||||
if (item->pid == pid) {
|
||||
if (!cr_dump_fdset_open(item->pid, CR_FD_DESC_USE(CR_FD_PSTREE), cr_fdset))
|
||||
goto err;
|
||||
if (dump_pstree(pid, &pstree_list, cr_fdset))
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prepare for socket queues in advance. They are not per-task,
|
||||
* but per-someother-task which makes restore tricky. Thus save
|
||||
|
Reference in New Issue
Block a user