From 49877012e313ca5efd9c68837cf793969cb01f76 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Tue, 12 Apr 2016 21:14:00 +0300 Subject: [PATCH] zdtm: check the mem_dirty_track if --pre or --snap is set Signed-off-by: Andrew Vagin Signed-off-by: Pavel Emelyanov --- criu/cr-check.c | 5 ++++- test/zdtm.py | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/criu/cr-check.c b/criu/cr-check.c index ef00f263b..7480dc249 100644 --- a/criu/cr-check.c +++ b/criu/cr-check.c @@ -692,8 +692,10 @@ static int check_mem_dirty_track(void) if (kerndat_get_dirty_track() < 0) return -1; - if (!kdat.has_dirty_track) + if (!kdat.has_dirty_track) { pr_warn("Dirty tracking is OFF. Memory snapshot will not work.\n"); + return -1; + } return 0; } @@ -1002,6 +1004,7 @@ struct feature_list { static struct feature_list feature_list[] = { { "mnt_id", check_mnt_id }, + { "mem_dirty_track", check_mem_dirty_track }, { "aio_remap", check_aio_remap }, { "timerfd", check_timerfd }, { "tun", check_tun }, diff --git a/test/zdtm.py b/test/zdtm.py index 267bb59e5..b8b2eaad0 100755 --- a/test/zdtm.py +++ b/test/zdtm.py @@ -1188,6 +1188,11 @@ def run_tests(opts): excl = None features = {} + if opts['pre'] or opts['snaps']: + if not criu_cli.check("mem_dirty_track"): + print "Tracking memory is not available" + return; + if opts['keep_going'] and (not opts['all']): print "[WARNING] Option --keep-going is more useful with option --all."