mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-31 14:00:12 +00:00
restore: call post-restore scripts before network-unlock
post-restore script can fail, so it can't be called after network-unlock. Signed-off-by: Andrey Vagin <avagin@openvz.org> Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
0bae3bc181
commit
a7fb6a1f41
1 changed files with 8 additions and 7 deletions
15
cr-restore.c
15
cr-restore.c
|
|
@ -1516,6 +1516,14 @@ static int restore_root_task(struct pstree_item *init)
|
|||
goto out_kill;
|
||||
}
|
||||
|
||||
ret = run_scripts("post-restore");
|
||||
if (ret != 0) {
|
||||
pr_err("Aborting restore due to script ret code %d\n", ret);
|
||||
timing_stop(TIME_RESTORE);
|
||||
write_stats(RESTORE_STATS);
|
||||
goto out_kill;
|
||||
}
|
||||
|
||||
/* Unlock network before disabling repair mode on sockets */
|
||||
network_unlock();
|
||||
|
||||
|
|
@ -1529,13 +1537,6 @@ static int restore_root_task(struct pstree_item *init)
|
|||
|
||||
timing_stop(TIME_RESTORE);
|
||||
|
||||
ret = run_scripts("post-restore");
|
||||
if (ret != 0) {
|
||||
pr_warn("Aborting restore due to script ret code %d\n", ret);
|
||||
write_stats(RESTORE_STATS);
|
||||
goto out_kill;
|
||||
}
|
||||
|
||||
ret = attach_to_tasks();
|
||||
|
||||
pr_info("Restore finished successfully. Resuming tasks.\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue