summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-02-15 15:18:43 +0000
committerZdenek Kabelac <zkabelac@redhat.com>2012-02-15 15:18:43 +0000
commitd81498a824e66acca994807643e9df1e452fd61c (patch)
tree1783c57c308ad26276cd8188ebe2cddb7450121c
parent386220ada26f29eb9b340b0a9ebe3b5a76a4e7e7 (diff)
downloadlvm2-d81498a824e66acca994807643e9df1e452fd61c.tar.gz
lvm2-d81498a824e66acca994807643e9df1e452fd61c.tar.xz
lvm2-d81498a824e66acca994807643e9df1e452fd61c.zip
Initialize dmeventd monitoring for every command
Read lvm.conf setting for monitoring for each command. So we should not activate monitoring if the default compilation is set to monitor during lvconvert commnads. Patch also removes check for clustered VG and allows to disable monitoring for clustered VG with the assumption, the problem with monitoring and dmeventd flag passing for INGNORE is already fixed.
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/metadata/lv_manip.c2
-rw-r--r--lib/metadata/metadata-exported.h1
-rw-r--r--liblvm/lvm_lv.c1
-rw-r--r--tools/lvchange.c7
-rw-r--r--tools/lvcreate.c4
-rw-r--r--tools/lvmcmdline.c6
-rw-r--r--tools/toollib.c11
-rw-r--r--tools/toollib.h1
-rw-r--r--tools/vgchange.c6
10 files changed, 8 insertions, 32 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 384d2be3..e55bc52d 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 464e4207..5d3fba5d 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 f1d6d698..412144d1 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 f8ef2f16..336b7142 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 ac761779..58581918 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 c7a347f9..7d3a5b0f 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 2b4d51d9..874f5bd0 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 bd24dad8..049604a1 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 1ef83f68..b3b0a7c1 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 6332117e..e4933eae 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