mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 06:15:24 +00:00
cr-restore: fix to print correct length of bootstrap
The length of bootstrap in the print is old and wrong, we need to fix it and unify the length variable. Signed-off-by: Huang Qiang <h.huangqiang@huawei.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
60d382f990
commit
f33df79e1e
14
cr-restore.c
14
cr-restore.c
@@ -1318,6 +1318,7 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core, struct list_head *tgt_v
|
|||||||
|
|
||||||
long new_sp, exec_mem_hint;
|
long new_sp, exec_mem_hint;
|
||||||
long ret;
|
long ret;
|
||||||
|
long restore_bootstrap_len;
|
||||||
|
|
||||||
struct task_restore_core_args *task_args;
|
struct task_restore_core_args *task_args;
|
||||||
struct thread_restore_args *thread_args;
|
struct thread_restore_args *thread_args;
|
||||||
@@ -1362,21 +1363,22 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core, struct list_head *tgt_v
|
|||||||
current->nr_threads,
|
current->nr_threads,
|
||||||
KBYTES(restore_thread_vma_len));
|
KBYTES(restore_thread_vma_len));
|
||||||
|
|
||||||
exec_mem_hint = restorer_get_vma_hint(pid, tgt_vmas, &self_vma_list,
|
restore_bootstrap_len = restorer_len +
|
||||||
restorer_len +
|
|
||||||
restore_task_vma_len +
|
restore_task_vma_len +
|
||||||
restore_thread_vma_len +
|
restore_thread_vma_len +
|
||||||
self_vmas_len + vmas_len +
|
|
||||||
SHMEMS_SIZE + TASK_ENTRIES_SIZE +
|
SHMEMS_SIZE + TASK_ENTRIES_SIZE +
|
||||||
rst_tcp_socks_size);
|
self_vmas_len + vmas_len +
|
||||||
|
rst_tcp_socks_size;
|
||||||
|
exec_mem_hint = restorer_get_vma_hint(pid, tgt_vmas, &self_vma_list,
|
||||||
|
restore_bootstrap_len);
|
||||||
if (exec_mem_hint == -1) {
|
if (exec_mem_hint == -1) {
|
||||||
pr_err("No suitable area for task_restore bootstrap (%ldK)\n",
|
pr_err("No suitable area for task_restore bootstrap (%ldK)\n",
|
||||||
restore_task_vma_len + restore_thread_vma_len);
|
restore_bootstrap_len);
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_info("Found bootstrap VMA hint at: 0x%lx (needs ~%ldK)\n", exec_mem_hint,
|
pr_info("Found bootstrap VMA hint at: 0x%lx (needs ~%ldK)\n", exec_mem_hint,
|
||||||
KBYTES(restore_task_vma_len + restore_thread_vma_len));
|
KBYTES(restore_bootstrap_len));
|
||||||
|
|
||||||
ret = remap_restorer_blob((void *)exec_mem_hint);
|
ret = remap_restorer_blob((void *)exec_mem_hint);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
Reference in New Issue
Block a user