]> sourceware.org Git - lvm2.git/commitdiff
lvconvert: more support for yes conversion
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 8 Jul 2020 08:57:52 +0000 (10:57 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 8 Jul 2020 09:37:33 +0000 (11:37 +0200)
When converting volume to pool LV use also wiping of other signatures.
For writecache & pool conversion support --yet and --force
to bypass prompting for signature wiping.
For writecache drop unneded zero_sectors.

Note: currently we have lvconvert doing convertion and prompting
for confirmation of conversion - and then again wipe_lv() prompts
for removing i.e. filesystem signature - we should unify this
prompting into 1 message  - althought the 'filesystem' discovery
needs active volume - while the 1st. conversion prompt can
work without active converted volume.

tools/lvconvert.c

index 61256c698712026ff8f4e285e5626f6a9d8bc633..0dcc776896f9521130e89db2a31b4cd65670865f 100644 (file)
@@ -3279,7 +3279,11 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
                        }
                        metadata_lv->status &= ~LV_ACTIVATION_SKIP;
 
-                       if (!wipe_lv(metadata_lv, (struct wipe_params) { .do_zero = 1 })) {
+                       if (!wipe_lv(metadata_lv, (struct wipe_params) {
+                                                 .do_wipe_signatures = 1,
+                                                 .is_metadata = 1,
+                                                 .yes = arg_count(cmd, yes_ARG),
+                                                 .force = arg_count(cmd, force_ARG) } )) {
                                log_error("Aborting. Failed to wipe metadata lv.");
                                goto bad;
                        }
@@ -5502,7 +5506,8 @@ static int _writecache_zero(struct cmd_context *cmd, struct logical_volume *lv)
        struct wipe_params wp = {
                .do_wipe_signatures = 1, /* optional, to print warning if clobbering something */
                .do_zero = 1,            /* required for dm-writecache to work */
-               .zero_sectors = 1
+               .yes = arg_count(cmd, yes_ARG),
+               .force = arg_count(cmd, force_ARG)
        };
        int ret;
 
This page took 0.041456 seconds and 5 git commands to generate.