mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 10:16:41 +00:00
cr-restore: Move cr_plugin_init after fdstore_init
Currently, when CRIU calls `cr_plugin_init`, `fdstore` is not initialized. However, during the plugin restore procedure, there may be some common file operations used in multiple hooks. This patch moves `cr_plugin_init` after `fdstore_init`, allowing `cr_plugin_init` to use `fdstore` to place these file operations. Signed-off-by: Yanning Yang <yangyanning@sjtu.edu.cn>
This commit is contained in:
parent
427c0dc27b
commit
497109eb4e
1 changed files with 18 additions and 12 deletions
|
|
@ -2366,41 +2366,47 @@ int cr_restore_tasks(void)
|
|||
return 1;
|
||||
|
||||
if (check_img_inventory(/* restore = */ true) < 0)
|
||||
goto err;
|
||||
|
||||
if (cr_plugin_init(CR_PLUGIN_STAGE__RESTORE))
|
||||
return -1;
|
||||
|
||||
if (init_stats(RESTORE_STATS))
|
||||
goto err;
|
||||
return -1;
|
||||
|
||||
if (lsm_check_opts())
|
||||
goto err;
|
||||
return -1;
|
||||
|
||||
timing_start(TIME_RESTORE);
|
||||
|
||||
if (cpu_init() < 0)
|
||||
goto err;
|
||||
return -1;
|
||||
|
||||
if (vdso_init_restore())
|
||||
goto err;
|
||||
return -1;
|
||||
|
||||
if (tty_init_restore())
|
||||
goto err;
|
||||
return -1;
|
||||
|
||||
if (opts.cpu_cap & CPU_CAP_IMAGE) {
|
||||
if (cpu_validate_cpuinfo())
|
||||
goto err;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (prepare_task_entries() < 0)
|
||||
goto err;
|
||||
return -1;
|
||||
|
||||
if (prepare_pstree() < 0)
|
||||
goto err;
|
||||
return -1;
|
||||
|
||||
if (fdstore_init())
|
||||
goto err;
|
||||
return -1;
|
||||
|
||||
/*
|
||||
* For the AMDGPU plugin, its parallel restore feature needs to use fdstore to store
|
||||
* its socket file descriptor. This allows the main process and the target process to
|
||||
* communicate with each other through this file descriptor. Therefore, cr_plugin_init
|
||||
* must be initialized after fdstore_init.
|
||||
*/
|
||||
if (cr_plugin_init(CR_PLUGIN_STAGE__RESTORE))
|
||||
return -1;
|
||||
|
||||
if (inherit_fd_move_to_fdstore())
|
||||
goto err;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue