[CRIU] [PATCH 05/15] parasite: prep_ctl doesn't search place for syscall if vma_list is NULL
Andrey Vagin
avagin at openvz.org
Mon Sep 23 06:33:28 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 19962f8..8be6e5e 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -885,6 +885,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;
@@ -914,6 +917,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 "
@@ -921,8 +931,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