[CRIU] [PATCH 67/78] pie: Split parasite_service into pieces

Cyrill Gorcunov gorcunov at openvz.org
Mon Nov 7 08:36:52 PST 2016


From: Pavel Emelyanov <xemul at virtuozzo.com>

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/pie/parasite.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c
index 7c016883b97b..6d484a9d9375 100644
--- a/criu/pie/parasite.c
+++ b/criu/pie/parasite.c
@@ -788,6 +788,17 @@ err:
 	return -1;
 }
 
+static int parasite_trap_cmd(int cmd, void *args)
+{
+	switch (cmd) {
+	case PARASITE_CMD_DUMP_THREAD:
+		return dump_thread(args);
+	}
+
+	pr_err("Unknown command to parasite: %d\n", cmd);
+	return -EINVAL;
+}
+
 #ifndef __parasite_entry
 # define __parasite_entry
 #endif
@@ -797,16 +808,13 @@ int __used __parasite_entry parasite_service(unsigned int cmd, void *args)
 	pr_info("Parasite cmd %d/%x process\n", cmd, cmd);
 
 	switch (cmd) {
-	case PARASITE_CMD_DUMP_THREAD:
-		return dump_thread(args);
 	case PARASITE_CMD_INIT_DAEMON:
 		return parasite_init_daemon(args);
 	case PARASITE_CMD_UNMAP:
 		return unmap_itself(args);
 	}
 
-	pr_err("Unknown command to parasite: %d\n", cmd);
-	return -EINVAL;
+	return parasite_trap_cmd(cmd, args);
 }
 
 /*
-- 
2.7.4



More information about the CRIU mailing list