]> sourceware.org Git - lvm2.git/commitdiff
Make lvconvert respect --yes/--force in the inactive log conversion
authorPetr Rockai <prockai@redhat.com>
Tue, 12 Oct 2010 16:41:17 +0000 (16:41 +0000)
committerPetr Rockai <prockai@redhat.com>
Tue, 12 Oct 2010 16:41:17 +0000 (16:41 +0000)
prompt. Fixes BZs 642055, 621281. Patch by Taka.

Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
lib/metadata/metadata-exported.h
lib/metadata/mirror.c
tools/lvconvert.c

index 447e4afd74f0ba7d8e0e69e3aa6f9cb3472b968e..f2e59df1d01f8e301a110b3d9cae242d40717a02 100644 (file)
@@ -652,7 +652,7 @@ int add_mirror_images(struct cmd_context *cmd, struct logical_volume *lv,
 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);
index b3f1c0f1201bd224ff225e5112a5195d52727613..083e9cd6c089bbbec23127a1b8a01d82ca32334b 100644 (file)
@@ -1573,7 +1573,8 @@ int add_mirrors_to_segments(struct cmd_context *cmd, 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)
 {
        float sync_percent;
        percent_range_t percent_range = PERCENT_0;
@@ -1597,7 +1598,7 @@ int remove_mirror_log(struct cmd_context *cmd,
                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;
index d39030bfb381a2b911d6641ea6a2735b5ec2af4c..f9d33e986da4e169385eaa98a02c0e1ad27d8af8 100644 (file)
@@ -747,7 +747,9 @@ static int _lv_update_log_type(struct cmd_context *cmd,
 
        /* 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;
        }
This page took 0.047171 seconds and 5 git commands to generate.