mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
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.
This commit is contained in:
parent
386220ada2
commit
d81498a824
@ -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().
|
||||
|
@ -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)) {
|
||||
|
@ -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 */
|
||||
|
@ -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 */
|
||||
|
@ -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
|
||||
|
@ -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) ||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user