]> sourceware.org Git - lvm2.git/commitdiff
lvconvert: allow implied cache pool convert
authorDavid Teigland <teigland@redhat.com>
Wed, 20 Jul 2016 15:44:28 +0000 (10:44 -0500)
committerDavid Teigland <teigland@redhat.com>
Wed, 20 Jul 2016 15:44:28 +0000 (10:44 -0500)
Just as with the implied thin pool convert when
given ambiguous command line options.

tools/lvconvert.c

index 2e84348a92f7264c9c7602ccf929be1f3078c12f..2fd6094ba614aa533fa1775ce562dee418b19368 100644 (file)
@@ -4201,7 +4201,9 @@ static int _convert_raid(struct cmd_context *cmd, struct logical_volume *lv,
        if ((new_type && !strcmp(new_type, SEG_TYPE_NAME_THIN_POOL)) || arg_is_set(cmd, thinpool_ARG))
                return _convert_raid_thin_pool(cmd, lv, lp);
 
-       if (new_type && !strcmp(new_type, SEG_TYPE_NAME_CACHE_POOL))
+       /* Using --cachepool is ambiguous and not preferred. */
+
+       if ((new_type && !strcmp(new_type, SEG_TYPE_NAME_CACHE_POOL)) || arg_is_set(cmd, cachepool_ARG))
                return _convert_raid_cache_pool(cmd, lv, lp);
 
        if (new_type && new_segtype && segtype_is_raid(new_segtype))
@@ -4261,7 +4263,9 @@ static int _convert_striped(struct cmd_context *cmd, struct logical_volume *lv,
        if ((new_type && !strcmp(new_type, SEG_TYPE_NAME_THIN_POOL)) || arg_is_set(cmd, thinpool_ARG))
                return _convert_striped_thin_pool(cmd, lv, lp);
 
-       if (new_type && !strcmp(new_type, SEG_TYPE_NAME_CACHE_POOL))
+       /* Using --cachepool is ambiguous and not preferred. */
+
+       if ((new_type && !strcmp(new_type, SEG_TYPE_NAME_CACHE_POOL)) || arg_is_set(cmd, cachepool_ARG))
                return _convert_striped_cache_pool(cmd, lv, lp);
 
        if (new_type && !strcmp(new_type, SEG_TYPE_NAME_MIRROR))
This page took 0.044556 seconds and 5 git commands to generate.