From: Alasdair Kergon Date: Mon, 16 Aug 2010 23:29:09 +0000 (+0000) Subject: Don't really change monitoring status when in test mode. X-Git-Tag: v2_02_91~1594 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=85a80e050525dcd26f5e659bf9ab5e9a2339d3b4;p=lvm2.git Don't really change monitoring status when in test mode. --- 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;