mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 07:15:31 +00:00
cr: Remove opts argument from cr_dump_tasks
Options are collected in global variable, no need to have them on stack. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
14
cr-dump.c
14
cr-dump.c
@@ -1043,7 +1043,7 @@ static int collect_pstree_ids(void)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int collect_pstree(pid_t pid, const struct cr_options *opts)
|
static int collect_pstree(pid_t pid)
|
||||||
{
|
{
|
||||||
int ret, attempts = 5;
|
int ret, attempts = 5;
|
||||||
|
|
||||||
@@ -1093,12 +1093,12 @@ try_again:
|
|||||||
return collect_pstree_ids();
|
return collect_pstree_ids();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int collect_file_locks(const struct cr_options *opts)
|
static int collect_file_locks(void)
|
||||||
{
|
{
|
||||||
if (parse_file_locks())
|
if (parse_file_locks())
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (opts->handle_file_locks)
|
if (opts.handle_file_locks)
|
||||||
/*
|
/*
|
||||||
* If the handle file locks option(-l) is set,
|
* If the handle file locks option(-l) is set,
|
||||||
* collect work is over.
|
* collect work is over.
|
||||||
@@ -1550,7 +1550,7 @@ err_cure_fdset:
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
|
int cr_dump_tasks(pid_t pid)
|
||||||
{
|
{
|
||||||
struct pstree_item *item;
|
struct pstree_item *item;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
@@ -1571,13 +1571,13 @@ int cr_dump_tasks(pid_t pid, const struct cr_options *opts)
|
|||||||
if (connect_to_page_server())
|
if (connect_to_page_server())
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (collect_pstree(pid, opts))
|
if (collect_pstree(pid))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (network_lock())
|
if (network_lock())
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (collect_file_locks(opts))
|
if (collect_file_locks())
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (collect_mount_info(pid))
|
if (collect_mount_info(pid))
|
||||||
@@ -1635,7 +1635,7 @@ err:
|
|||||||
if (ret)
|
if (ret)
|
||||||
network_unlock();
|
network_unlock();
|
||||||
pstree_switch_state(root_item,
|
pstree_switch_state(root_item,
|
||||||
ret ? TASK_ALIVE : opts->final_state);
|
ret ? TASK_ALIVE : opts.final_state);
|
||||||
timing_stop(TIME_FROZEN);
|
timing_stop(TIME_FROZEN);
|
||||||
free_pstree(root_item);
|
free_pstree(root_item);
|
||||||
free_file_locks();
|
free_file_locks();
|
||||||
|
@@ -302,7 +302,7 @@ int main(int argc, char *argv[])
|
|||||||
if (!strcmp(argv[optind], "dump")) {
|
if (!strcmp(argv[optind], "dump")) {
|
||||||
if (!tree_id)
|
if (!tree_id)
|
||||||
goto opt_pid_missing;
|
goto opt_pid_missing;
|
||||||
return cr_dump_tasks(tree_id, &opts);
|
return cr_dump_tasks(tree_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp(argv[optind], "restore")) {
|
if (!strcmp(argv[optind], "restore")) {
|
||||||
|
@@ -223,7 +223,7 @@ static inline int fdset_fd(const struct cr_fdset *fdset, int type)
|
|||||||
extern struct cr_fdset *glob_fdset;
|
extern struct cr_fdset *glob_fdset;
|
||||||
extern struct cr_options opts;
|
extern struct cr_options opts;
|
||||||
|
|
||||||
int cr_dump_tasks(pid_t pid, const struct cr_options *opts);
|
int cr_dump_tasks(pid_t pid);
|
||||||
int cr_restore_tasks(struct cr_options *opts);
|
int cr_restore_tasks(struct cr_options *opts);
|
||||||
int cr_show(struct cr_options *opts, int pid);
|
int cr_show(struct cr_options *opts, int pid);
|
||||||
int convert_to_elf(char *elf_path, int fd_core);
|
int convert_to_elf(char *elf_path, int fd_core);
|
||||||
|
Reference in New Issue
Block a user