int merge;
int merge_mirror;
int poolmetadataspare;
+ int repair;
int thin;
int uncache;
int yes;
lp->lv_name = lp->lv_name_full;
if (!lp->merge_mirror &&
- !arg_count(cmd, repair_ARG) &&
+ !lp->repair &&
!arg_count(cmd, splitmirrors_ARG) &&
!strstr(lp->lv_name, "_tdata") &&
!strstr(lp->lv_name, "_tmeta") &&
if (!_check_conversion_type(cmd, type_str))
return_0;
- if (arg_count(cmd, repair_ARG) &&
- arg_outside_list_is_set(cmd, "cannot be used with --repair",
- repair_ARG,
- alloc_ARG, usepolicies_ARG,
- stripes_long_ARG, stripesize_ARG,
- force_ARG, noudevsync_ARG, test_ARG,
- -1))
- return_0;
+ if (arg_count(cmd, repair_ARG)) {
+ if (arg_outside_list_is_set(cmd, "cannot be used with --repair",
+ repair_ARG,
+ alloc_ARG, usepolicies_ARG,
+ stripes_long_ARG, stripesize_ARG,
+ force_ARG, noudevsync_ARG, test_ARG,
+ -1))
+ return_0;
+ lp->repair = 1;
+ }
if (arg_is_set(cmd, mirrorlog_ARG) && arg_is_set(cmd, corelog_ARG)) {
log_error("--mirrorlog and --corelog are incompatible.");
if ((_snapshot_type_requested(cmd, type_str) || arg_count(cmd, merge_ARG)) &&
(arg_count(cmd, mirrorlog_ARG) || _mirror_or_raid_type_requested(cmd, type_str) ||
- arg_count(cmd, repair_ARG) || arg_count(cmd, thinpool_ARG))) {
+ lp->repair || arg_count(cmd, thinpool_ARG))) {
log_error("--snapshot/--type snapshot or --merge argument "
"cannot be mixed with --mirrors/--type mirror/--type raid*, "
"--mirrorlog, --repair or --thinpool.");
if ((arg_count(cmd, stripes_long_ARG) || arg_count(cmd, stripesize_ARG)) &&
!(_mirror_or_raid_type_requested(cmd, type_str) ||
- arg_count(cmd, repair_ARG) ||
+ lp->repair ||
arg_count(cmd, thinpool_ARG))) {
log_error("--stripes or --stripesize argument is only valid "
"with --mirrors/--type mirror/--type raid*, --repair and --thinpool");
uint32_t *new_mimage_count,
uint32_t *new_log_count)
{
- int repair = arg_count(cmd, repair_ARG);
*old_mimage_count = lv_mirror_count(lv);
*old_log_count = _get_log_count(lv);
*/
if (!arg_count(cmd, mirrors_ARG) && !arg_count(cmd, mirrorlog_ARG) &&
!arg_count(cmd, corelog_ARG) && !arg_count(cmd, regionsize_ARG) &&
- !arg_count(cmd, splitmirrors_ARG) && !repair) {
+ !arg_count(cmd, splitmirrors_ARG) && !lp->repair) {
*new_mimage_count = *old_mimage_count;
*new_log_count = *old_log_count;
struct logical_volume *lv,
struct lvconvert_params *lp)
{
- int repair = arg_count(cmd, repair_ARG);
uint32_t old_mimage_count;
uint32_t old_log_count;
uint32_t new_mimage_count;
/* Nothing to do? (Probably finishing collapse.) */
if ((old_mimage_count == new_mimage_count) &&
- (old_log_count == new_log_count) && !repair)
+ (old_log_count == new_log_count) && !lp->repair)
return 1;
- if (repair)
+ if (lp->repair)
return _lvconvert_mirrors_repair(cmd, lv, lp);
if (!_lvconvert_mirrors_aux(cmd, lv, lp, NULL,
if (arg_count(cmd, replace_ARG))
return lv_raid_replace(lv, lp->replace_pvh, lp->pvh);
- if (arg_count(cmd, repair_ARG)) {
+ if (lp->repair) {
if (!lv_is_active_exclusive_locally(lv_lock_holder(lv))) {
log_error("%s/%s must be active %sto perform this"
" operation.", lv->vg->name, lv->name,
}
}
- if (arg_count(cmd, repair_ARG)) {
+ if (lp->repair) {
if (lv_is_pool(lv)) {
if (lv_is_cache_pool(lv)) {
log_error("Repair for cache pool %s not yet implemented.",
return_ECMD_FAILED;
/* If repairing and using policies, remove missing PVs from VG */
- if (arg_count(cmd, repair_ARG) && arg_count(cmd, usepolicies_ARG))
+ if (lp->repair && arg_count(cmd, usepolicies_ARG))
_remove_missing_empty_pv(lv->vg, failed_pvs);
} else if (arg_count(cmd, mirrors_ARG) ||
arg_count(cmd, splitmirrors_ARG) ||
return_ECMD_FAILED;
/* If repairing and using policies, remove missing PVs from VG */
- if (arg_count(cmd, repair_ARG) && arg_count(cmd, usepolicies_ARG))
+ if (lp->repair && arg_count(cmd, usepolicies_ARG))
_remove_missing_empty_pv(lv->vg, failed_pvs);
}
int saved_ignore_suspended_devices = ignore_suspended_devices();
uint32_t lockd_state = 0;
- if (arg_count(cmd, repair_ARG)) {
+ if (lp->repair) {
init_ignore_suspended_devices(1);
cmd->handles_missing_pvs = 1;
}