[CRIU] [PATCH 2/4] parasite: Move call to arch_can_dump_task lower

Pavel Emelyanov xemul at virtuozzo.com
Sun Oct 30 00:37:03 PDT 2016


It doesn't matter much how late we check this, but in the
new place we already have parasite_ctl I will need in the
next patch.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/parasite-syscall.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
index 2fe6e87..5ebb7aa 100644
--- a/criu/parasite-syscall.c
+++ b/criu/parasite-syscall.c
@@ -1243,9 +1243,6 @@ struct parasite_ctl *parasite_prep_ctl(pid_t pid, unsigned long exec_start)
 {
 	struct parasite_ctl *ctl = NULL;
 
-	if (!arch_can_dump_task(pid))
-		goto err;
-
 	/*
 	 * Control block early setup.
 	 */
@@ -1481,6 +1478,8 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct pstree_item *item,
 	parasite_ensure_args_size(dump_pages_args_size(vma_area_list));
 	parasite_ensure_args_size(aio_rings_args_size(vma_area_list));
 
+	if (!arch_can_dump_task(pid))
+		goto err_restore;
 	/*
 	 * Inject a parasite engine. Ie allocate memory inside alien
 	 * space and copy engine code there. Then re-map the engine
-- 
2.5.0



More information about the CRIU mailing list