prompt. Fixes BZs 642055, 621281. Patch by Taka.
Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
struct logical_volume *detach_mirror_log(struct lv_segment *seg);
int attach_mirror_log(struct lv_segment *seg, struct logical_volume *lv);
int remove_mirror_log(struct cmd_context *cmd, struct logical_volume *lv,
- struct dm_list *removable_pvs);
+ struct dm_list *removable_pvs, int force);
int add_mirror_log(struct cmd_context *cmd, struct logical_volume *lv,
uint32_t log_count, uint32_t region_size,
struct dm_list *allocatable_pvs, alloc_policy_t alloc);
*/
int remove_mirror_log(struct cmd_context *cmd,
struct logical_volume *lv,
- struct dm_list *removable_pvs)
+ struct dm_list *removable_pvs,
+ int force)
{
float sync_percent;
percent_range_t percent_range = PERCENT_0;
log_error("Unable to convert the log of an inactive "
"cluster mirror, %s", lv->name);
return 0;
- } else if (yes_no_prompt("Full resync required to convert "
+ } else if (force || yes_no_prompt("Full resync required to convert "
"inactive mirror %s to core log. "
"Proceed? [y/n]: ", lv->name) == 'y')
sync_percent = 0;
/* Remove an existing log completely */
if (!log_count) {
- if (!remove_mirror_log(cmd, original_lv, operable_pvs))
+ if (!remove_mirror_log(cmd, original_lv, operable_pvs,
+ arg_count(cmd, yes_ARG) ||
+ arg_count(cmd, force_ARG)))
return_0;
return 1;
}