Commit 52247b12 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

restorer: don't need to restore pages content in restorer

All memory content are restored before entering in restorer.c.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 949af72b
......@@ -1538,7 +1538,6 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
struct thread_restore_args *thread_args;
LIST_HEAD(self_vma_list);
int fd_pages = -1;
int i;
pr_info("Restore via sigreturn\n");
......@@ -1564,12 +1563,6 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
BUILD_BUG_ON(SHMEMS_SIZE % PAGE_SIZE);
BUILD_BUG_ON(TASK_ENTRIES_SIZE % PAGE_SIZE);
fd_pages = open_image_ro(CR_FD_PAGES, pid);
if (fd_pages < 0) {
pr_perror("Can't open pages-%d", pid);
goto free;
}
restore_task_vma_len = round_up(sizeof(*task_args), PAGE_SIZE);
restore_thread_vma_len = round_up(sizeof(*thread_args) * current->nr_threads, PAGE_SIZE);
......@@ -1679,7 +1672,6 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
task_args->logfd = log_get_fd();
task_args->loglevel = log_get_loglevel();
task_args->sigchld_act = sigchld_act;
task_args->fd_pages = fd_pages;
strncpy(task_args->comm, core->tc->comm, sizeof(task_args->comm));
......@@ -1810,8 +1802,6 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
: "rsp", "rdi", "rsi", "rbx", "rax", "memory");
err:
close_safe(&fd_pages);
free:
free_mappings(&self_vma_list);
/* Just to be sure */
......
......@@ -85,7 +85,6 @@ struct task_restore_core_args {
struct thread_restore_args t; /* thread group leader */
int fd_exe_link; /* opened self->exe file */
int fd_pages; /* opened pages dump file */
int logfd;
unsigned int loglevel;
......
......@@ -511,28 +511,6 @@ long __export_restore_task(struct task_restore_core_args *args)
}
}
/*
* Read page contents.
*/
while (1) {
ret = sys_read(args->fd_pages, &va, sizeof(va));
if (!ret)
break;
if (ret != sizeof(va)) {
pr_err("Bad mapping page size %ld\n", ret);
goto core_restore_end;
}
ret = sys_read(args->fd_pages, (void *)va, PAGE_SIZE);
if (ret != PAGE_SIZE) {
pr_err("Can'r read mapping page %ld\n", ret);
goto core_restore_end;
}
}
sys_close(args->fd_pages);
/*
* Walk though all VMAs again to drop PROT_WRITE
* if it was not there.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment