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

Submitted by Pavel Emelianov on Oct. 30, 2016, 7:37 a.m.

Details

Message ID 5815A31F.4060309@virtuozzo.com
State Superseded
Series "Don't get task regs twice"
Headers show

Commit Message

Pavel Emelianov Oct. 30, 2016, 7:37 a.m.
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@virtuozzo.com>
---
 criu/parasite-syscall.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

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