[CRIU] [PATCH 4/8] parasite: prep_ctl doesn't search place for syscall if vma_list is NULL

Andrey Vagin avagin at openvz.org
Fri Sep 13 09:06:08 EDT 2013


This feature will be used for unmaping restorer blobs. All reqired code
will be in the blob.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 parasite-syscall.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/parasite-syscall.c b/parasite-syscall.c
index a8ef03d..63e7f98 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -881,6 +881,9 @@ int parasite_cure_seized(struct parasite_ctl *ctl)
 	return ret;
 }
 
+/*
+ * If vma_area_list is NULL, a place for injecting syscall will not be set.
+ */
 struct parasite_ctl *parasite_prep_ctl(pid_t pid, struct vm_area_list *vma_area_list)
 {
 	struct parasite_ctl *ctl = NULL;
@@ -910,6 +913,13 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, struct vm_area_list *vma_area_
 		goto err;
 	}
 
+	ctl->pid.real	= pid;
+	ctl->pid.virt	= 0;
+
+	if (vma_area_list == NULL)
+		return ctl;
+
+	/* Search a place for injecting syscall */
 	vma_area = get_vma_by_ip(&vma_area_list->h, REG_IP(ctl->regs_orig));
 	if (!vma_area) {
 		pr_err("No suitable VMA found to run parasite "
@@ -917,8 +927,6 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, struct vm_area_list *vma_area_
 		goto err;
 	}
 
-	ctl->pid.real	= pid;
-	ctl->pid.virt	= 0;
 	ctl->syscall_ip	= vma_area->vma.start;
 
 	return ctl;
-- 
1.8.3.1



More information about the CRIU mailing list