]> sourceware.org Git - lvm2.git/commitdiff
lvchange: allow activating cachevol
authorDavid Teigland <teigland@redhat.com>
Thu, 19 Sep 2019 21:18:47 +0000 (16:18 -0500)
committerDavid Teigland <teigland@redhat.com>
Fri, 20 Sep 2019 14:59:37 +0000 (09:59 -0500)
tools/lvchange.c

index 03a7793f55f680e6abf97f4c14522f1295c7f670..65cea6c969959cfdd6a8b446bc32e15c9cd022fa 100644 (file)
@@ -1391,6 +1391,20 @@ static int _lvchange_activate_check(struct cmd_context *cmd,
                                     struct processing_handle *handle,
                                     int lv_is_named_arg)
 {
+       int do_activate = is_change_activating((activation_change_t)arg_uint_value(cmd, activate_ARG, CHANGE_AY));
+
+       if (lv_is_cache_vol(lv) && lv_is_named_arg) {
+               if (!do_activate)
+                       return 1;
+
+               if (arg_is_set(cmd, yes_ARG) ||
+                   (yes_no_prompt("Do you want to activate component LV in read-only mode? [y/n]: ") == 'y')) {
+                       log_print_unless_silent("Allowing activation of component LV.");
+                       cmd->activate_component = 1;
+               }
+               return 1;
+       }
+
        if (!lv_is_visible(lv) &&
            !cmd->activate_component && /* activation of named component LV */
            ((first_seg(lv)->status & MERGING) || /* merging already started */
This page took 0.0365 seconds and 5 git commands to generate.