diff --git a/WHATS_NEW b/WHATS_NEW index 384d2be3f..e55bc52dd 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.92 - ==================================== + Read monitoring config settings for every lvm command. Initialize monitoring support only for thin pools and skip thin volumes. Make conversion from a synced 'mirror' to 'raid1' not cause a full resync. Properly test buffer for unit check in units_to_bytes(). diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 464e4207b..5d3fba5d3 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -4378,8 +4378,6 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l goto out; } - init_dmeventd_monitor(lp->activation_monitoring); - if (seg_is_thin(lp)) { /* For snapshot, suspend active thin origin first */ if (org && lv_is_active(org)) { diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index f1d6d6989..412144d18 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -574,7 +574,6 @@ struct lvcreate_params { int minor; /* all */ int log_count; /* mirror */ int nosync; /* mirror */ - int activation_monitoring; /* all */ activation_change_t activate; /* non-snapshot, non-mirror */ const char *origin; /* snap */ diff --git a/liblvm/lvm_lv.c b/liblvm/lvm_lv.c index f8ef2f16e..336b7142e 100644 --- a/liblvm/lvm_lv.c +++ b/liblvm/lvm_lv.c @@ -110,7 +110,6 @@ static void _lv_set_default_params(struct lvcreate_params *lp, lp->zero = 1; lp->major = -1; lp->minor = -1; - lp->activation_monitoring = DEFAULT_DMEVENTD_MONITOR; lp->activate = CHANGE_AY; lp->vg_name = vg->name; lp->lv_name = lvname; /* FIXME: check this for safety */ diff --git a/tools/lvchange.c b/tools/lvchange.c index ac7617793..585819183 100644 --- a/tools/lvchange.c +++ b/tools/lvchange.c @@ -524,7 +524,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv, void *handle __attribute__((unused))) { int doit = 0, docmds = 0; - int dmeventd_mode, archived = 0; + int archived = 0; struct logical_volume *origin; char snaps_msg[128]; @@ -595,11 +595,6 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv, return ECMD_FAILED; } - if (!get_activation_monitoring_mode(cmd, lv->vg, &dmeventd_mode)) - return ECMD_FAILED; - - init_dmeventd_monitor(dmeventd_mode); - /* * FIXME: DEFAULT_BACKGROUND_POLLING should be "unspecified". * If --poll is explicitly provided use it; otherwise polling diff --git a/tools/lvcreate.c b/tools/lvcreate.c index c7a347f9c..7d3a5b0fe 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -726,10 +726,6 @@ static int _lvcreate_params(struct lvcreate_params *lp, return 0; } - if (!get_activation_monitoring_mode(cmd, NULL, - &lp->activation_monitoring)) - return_0; - if (!_lvcreate_name_params(lp, cmd, &argc, &argv) || !_read_size_params(lp, lcp, cmd) || !get_stripe_params(cmd, &lp->stripes, &lp->stripe_size) || diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c index 2b4d51d90..874f5bd06 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -935,6 +935,7 @@ static void _apply_settings(struct cmd_context *cmd) init_test(cmd->current_settings.test); init_full_scan_done(0); init_mirror_in_sync(0); + init_dmeventd_monitor(DEFAULT_DMEVENTD_MONITOR); init_msg_prefix(cmd->default_settings.msg_prefix); init_cmd_name(cmd->default_settings.cmd_name); @@ -996,6 +997,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) { int ret = 0; int locking_type; + int monitoring; struct dm_config_tree *old_cft; init_error_message_produced(0); @@ -1041,6 +1043,10 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) goto_out; _apply_settings(cmd); + if (!get_activation_monitoring_mode(cmd, &monitoring)) + goto_out; + init_dmeventd_monitor(monitoring); + log_debug("Processing: %s", cmd->cmd_line); #ifdef O_DIRECT_SUPPORT diff --git a/tools/toollib.c b/tools/toollib.c index bd24dad8e..049604a12 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -1490,7 +1490,6 @@ int pvcreate_params_validate(struct cmd_context *cmd, } int get_activation_monitoring_mode(struct cmd_context *cmd, - struct volume_group *vg, int *monitoring_mode) { *monitoring_mode = DEFAULT_DMEVENTD_MONITOR; @@ -1511,16 +1510,6 @@ int get_activation_monitoring_mode(struct cmd_context *cmd, DEFAULT_DMEVENTD_MONITOR)) *monitoring_mode = DMEVENTD_MONITOR_IGNORE; - if (vg && vg_is_clustered(vg) && - *monitoring_mode == DMEVENTD_MONITOR_IGNORE) { - log_error("%s is incompatible with clustered Volume Group " - "\"%s\": Skipping.", - (arg_count(cmd, ignoremonitoring_ARG) ? - "--ignoremonitoring" : "activation/monitoring=0"), - vg->name); - return 0; - } - return 1; } diff --git a/tools/toollib.h b/tools/toollib.h index 1ef83f68b..b3b0a7c16 100644 --- a/tools/toollib.h +++ b/tools/toollib.h @@ -110,7 +110,6 @@ int pvcreate_params_validate(struct cmd_context *cmd, struct pvcreate_params *pp); int get_activation_monitoring_mode(struct cmd_context *cmd, - struct volume_group *vg, int *monitoring_mode); int get_stripe_params(struct cmd_context *cmd, uint32_t *stripes, uint32_t *stripe_size); diff --git a/tools/vgchange.c b/tools/vgchange.c index 6332117e1..e4933eae3 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c @@ -447,7 +447,6 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name, struct volume_group *vg, void *handle __attribute__((unused))) { - int dmeventd_mode; int archived = 0; int i; @@ -473,11 +472,6 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name, return ECMD_FAILED; } - if (!get_activation_monitoring_mode(cmd, vg, &dmeventd_mode)) - return ECMD_FAILED; - - init_dmeventd_monitor(dmeventd_mode); - /* * FIXME: DEFAULT_BACKGROUND_POLLING should be "unspecified". * If --poll is explicitly provided use it; otherwise polling