1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-18 10:04:20 +03:00

polldaemon: alter few lines related to interval

we do not allow 0 interval for pvmove command issued
without parameters with classical polldaemon. It would
query the kernel too often with possibly many pvmoves
in-progress.
This commit is contained in:
Ondrej Kozina 2015-03-17 18:44:25 +01:00
parent 7abb7894e4
commit f199aeb9ea

View File

@ -282,14 +282,6 @@ static int _poll_daemon(struct cmd_context *cmd, const char *name,
int daemon_mode = 0; int daemon_mode = 0;
int ret = ECMD_PROCESSED; int ret = ECMD_PROCESSED;
if (!parms->interval) {
parms->progress_display = 0;
/* FIXME Disabled multiple-copy wait_event */
if (!name)
parms->interval = find_config_tree_int(cmd, activation_polling_interval_CFG, NULL);
}
if (parms->background) { if (parms->background) {
daemon_mode = become_daemon(cmd, 0); daemon_mode = become_daemon(cmd, 0);
if (daemon_mode == 0) if (daemon_mode == 0)
@ -309,6 +301,8 @@ static int _poll_daemon(struct cmd_context *cmd, const char *name,
ret = ECMD_FAILED; ret = ECMD_FAILED;
} }
} else { } else {
if (!parms->interval)
parms->interval = find_config_tree_int(cmd, activation_polling_interval_CFG, NULL);
if (!(handle = init_processing_handle(cmd))) { if (!(handle = init_processing_handle(cmd))) {
log_error("Failed to initialize processing handle."); log_error("Failed to initialize processing handle.");
ret = ECMD_FAILED; ret = ECMD_FAILED;
@ -350,7 +344,6 @@ static int _daemon_parms_init(struct cmd_context *cmd, struct daemon_parms *parm
parms->interval = arg_uint_value(cmd, interval_ARG, parms->interval = arg_uint_value(cmd, interval_ARG,
find_config_tree_int(cmd, activation_polling_interval_CFG, NULL)); find_config_tree_int(cmd, activation_polling_interval_CFG, NULL));
parms->wait_before_testing = (interval_sign == SIGN_PLUS); parms->wait_before_testing = (interval_sign == SIGN_PLUS);
parms->progress_display = 1;
parms->progress_title = progress_title; parms->progress_title = progress_title;
parms->lv_type = lv_type; parms->lv_type = lv_type;
parms->poll_fns = poll_fns; parms->poll_fns = poll_fns;
@ -360,6 +353,8 @@ static int _daemon_parms_init(struct cmd_context *cmd, struct daemon_parms *parm
(parms->wait_before_testing ? "after" : "before"), (parms->wait_before_testing ? "after" : "before"),
parms->interval); parms->interval);
parms->progress_display = parms->interval ? 1 : 0;
return 1; return 1;
} }