activate = (activation_change_t) arg_uint_value(cmd, activate_ARG, 0);
if (!vgchange_activate(cmd, vg, activate))
return_ECMD_FAILED;
- }
-
- if (arg_is_set(cmd, refresh_ARG)) {
+ } else if (arg_is_set(cmd, refresh_ARG)) {
/* refreshes the visible LVs (which starts polling) */
if (!_vgchange_refresh(cmd, vg))
return_ECMD_FAILED;
- }
-
- if (!arg_is_set(cmd, activate_ARG) &&
- !arg_is_set(cmd, refresh_ARG) &&
- arg_is_set(cmd, monitor_ARG)) {
+ } else {
/* -ay* will have already done monitoring changes */
- if (!_vgchange_monitoring(cmd, vg))
+ if (arg_is_set(cmd, monitor_ARG) &&
+ !_vgchange_monitoring(cmd, vg))
return_ECMD_FAILED;
- }
- if (!arg_is_set(cmd, refresh_ARG) &&
- arg_is_set(cmd, poll_ARG) &&
- !vgchange_background_polling(cmd, vg))
- return_ECMD_FAILED;
+ /* When explicitelly specified --poll */
+ if (arg_is_set(cmd, poll_ARG) &&
+ !vgchange_background_polling(cmd, vg))
+ return_ECMD_FAILED;
+ }
return ret;
}