[CRIU] [PATCH 2/8] pre-dump: Enforce track-mem and leave-running in cr_pre_dump_tasks

Pavel Emelyanov xemul at parallels.com
Tue Jan 28 10:35:42 PST 2014


Service will call the pre-dump routine, so this is factoring out
enforcin options for CLI and RPC.

Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
---
 cr-dump.c | 10 ++++++++++
 crtools.c | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/cr-dump.c b/cr-dump.c
index 9476cd1..f979cb7 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -1602,6 +1602,16 @@ int cr_pre_dump_tasks(pid_t pid)
 	LIST_HEAD(ctls);
 	struct parasite_ctl *ctl, *n;
 
+	if (!opts.track_mem) {
+		pr_info("Enforcing memory tracking for pre-dump.\n");
+		opts.track_mem = true;
+	}
+
+	if (opts.final_state == TASK_DEAD) {
+		pr_info("Enforcing tasks run after pre-dump.\n");
+		opts.final_state = TASK_ALIVE;
+	}
+
 	if (init_stats(DUMP_STATS))
 		goto err;
 
diff --git a/crtools.c b/crtools.c
index da53b16..3b881e6 100644
--- a/crtools.c
+++ b/crtools.c
@@ -339,16 +339,6 @@ int main(int argc, char *argv[])
 		if (!tree_id)
 			goto opt_pid_missing;
 
-		if (!opts.track_mem) {
-			pr_info("Enforcing memory tracking for pre-dump.\n");
-			opts.track_mem = true;
-		}
-
-		if (opts.final_state == TASK_DEAD) {
-			pr_info("Enforcing tasks run after pre-dump.\n");
-			opts.final_state = TASK_ALIVE;
-		}
-
 		return cr_pre_dump_tasks(tree_id) != 0;
 	}
 
-- 
1.8.4.2


More information about the CRIU mailing list