[CRIU] [PATCH cr 12/16] restorer: don't need to restore pages content in restorer

Andrey Vagin avagin at openvz.org
Tue Oct 23 06:02:24 EDT 2012


All memory content are restored before entering in restorer.c.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-restore.c       |    8 --------
 include/restorer.h |    1 -
 restorer.c         |   22 ----------------------
 3 files changed, 0 insertions(+), 31 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index 0f76cc1..4dd68b4 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -1523,7 +1523,6 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core, struct list_head *tgt_v
 	struct thread_restore_args *thread_args;
 
 	LIST_HEAD(self_vma_list);
-	int fd_pages = -1;
 	int i;
 
 	pr_info("Restore via sigreturn\n");
@@ -1552,12 +1551,6 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core, struct list_head *tgt_v
 	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 err;
-	}
-
 	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);
 
@@ -1668,7 +1661,6 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core, struct list_head *tgt_v
 	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));
 
diff --git a/include/restorer.h b/include/restorer.h
index ebdfb1d..7e3ef89 100644
--- a/include/restorer.h
+++ b/include/restorer.h
@@ -75,7 +75,6 @@ struct task_restore_core_args {
 
 	int				pid;			/* task pid */
 	int				fd_exe_link;		/* opened self->exe file */
-	int				fd_pages;		/* opened pages dump file */
 	int				logfd;
 	unsigned int			loglevel;
 	bool				restore_threads;	/* if to restore threads */
diff --git a/restorer.c b/restorer.c
index 2b54042..7b8d016 100644
--- a/restorer.c
+++ b/restorer.c
@@ -444,28 +444,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.
 	 */
-- 
1.7.1



More information about the CRIU mailing list