mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
lvconvert: raid1 -> linear prompt
Avoid 2 prompts when downconverting raid1 to linear (related commit 0f65d7ec3a7325165af1a9f722cb760fd363e932).
This commit is contained in:
parent
3b1a96b9b3
commit
653bca6811
@ -3000,9 +3000,10 @@ int lv_raid_change_image_count(struct logical_volume *lv, int yes, uint32_t new_
|
|||||||
{
|
{
|
||||||
struct lv_segment *seg = first_seg(lv);
|
struct lv_segment *seg = first_seg(lv);
|
||||||
const char *level = seg->area_count == 1 ? "raid1 with " : "";
|
const char *level = seg->area_count == 1 ? "raid1 with " : "";
|
||||||
const char *resil = new_count == 1 ? " loosing all" : (new_count < seg->area_count ? "s reducing" : "s enhancing");
|
const char *resil = new_count < seg->area_count ? "reducing" : "enhancing";
|
||||||
|
|
||||||
if (!yes && yes_no_prompt("Are you sure you want to convert %s LV %s to %s%u image%s resilience? [y/n]: ",
|
if (new_count != 1 && /* Already prompted for in _raid_remove_images() */
|
||||||
|
!yes && yes_no_prompt("Are you sure you want to convert %s LV %s to %s%u images %s resilience? [y/n]: ",
|
||||||
lvseg_name(first_seg(lv)), display_lvname(lv), level, new_count, resil) == 'n') {
|
lvseg_name(first_seg(lv)), display_lvname(lv), level, new_count, resil) == 'n') {
|
||||||
log_error("Logical volume %s NOT converted.", display_lvname(lv));
|
log_error("Logical volume %s NOT converted.", display_lvname(lv));
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user