Skip to contentSkip to conversation

master - lvconvert: add missing alias for a thin-pool conversion

PATCH David Teigland 1 participant 1 message Jun 30, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a8e39530efdffc42d21e9bc968ab3966b719876a
Commit:        a8e39530efdffc42d21e9bc968ab3966b719876a
Parent:        802ed9d4597443e21086b392d9ee160f6d99dde9
Author:        David Teigland <[email protected]>
AuthorDate:    Thu Jun 30 10:09:54 2016 -0500
Committer:     David Teigland <[email protected]>
CommitterDate: Thu Jun 30 10:09:54 2016 -0500

lvconvert: add missing alias for a thin-pool conversion

The case of converting a cache volume to a thin pool missed recognizing the --thinpool alias for --type thin-pool.

---
 tools/lvconvert.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
tools/lvconvert.c +5 -1
index 4808090..8ceb1c7 100644
@@ -3718,9 +3718,13 @@ static int _convert_cache_volume(struct cmd_context *cmd, struct logical_volume
 	if (arg_is_set(cmd, splitmirrors_ARG))
 		return _convert_cache_volume_splitmirrors(cmd, lv, lp);
 
-	if (new_type && !strcmp(new_type, "thin-pool"))
+	/* The --thinpool alias is ambiguous and not preferred. */
+
+	if ((new_type && !strcmp(new_type, "thin-pool")) || arg_is_set(cmd, thinpool_ARG))
 		return _convert_cache_volume_thin_pool(cmd, lv, lp);
 
+	/* The --thinpool alias for --type thin-pool is not preferred, so not shown. */
+
 	log_error("Operation not permitted on cache LV %s", display_lvname(lv));
 	log_error("Operations permitted on a cache LV are:\n"
 		  "  --splitcache\n"