From 85a80e050525dcd26f5e659bf9ab5e9a2339d3b4 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Mon, 16 Aug 2010 23:29:09 +0000 Subject: [PATCH] Don't really change monitoring status when in test mode. --- WHATS_NEW | 1 + lib/activate/activate.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 05b19e098..ffacab7c5 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.73 - ================================ + Don't really change monitoring status when in test mode. Fix some exit statuses when starting/stopping monitoring fails. Enable snapshot monitoring by default when dmeventd is enabled. Move cloned libdevmapper-event client code from segments into lib/activate. diff --git a/lib/activate/activate.c b/lib/activate/activate.c index 0e0bd8b8b..68ddfefaa 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -940,7 +940,12 @@ int monitor_dev_for_events(struct cmd_context *cmd, if (!monitor_fn) continue; - log_verbose("%sonitoring %s/%s", monitor ? "M" : "Not m", lv->vg->name, lv->name); + log_verbose("%sonitoring %s/%s%s", monitor ? "M" : "Not m", lv->vg->name, lv->name, + test_mode() ? " [Test mode: skipping this]" : ""); + + /* FIXME Test mode should really continue a bit further. */ + if (test_mode()) + continue; /* FIXME specify events */ if (!monitor_fn(seg, 0)) { @@ -964,7 +969,8 @@ int monitor_dev_for_events(struct cmd_context *cmd, sleep(1); } - r = (monitored && monitor) || (!monitored && !monitor); + if (r) + r = (monitored && monitor) || (!monitored && !monitor); } return r;