Skip to contentSkip to conversation

master - commandline: add prefix aliases for raid options

PATCH Alasdair Kergon 1 participant 1 message Jul 19, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=90a09559ed689cbd62021ef0ff875913d43bc989
Commit:        90a09559ed689cbd62021ef0ff875913d43bc989
Parent:        4eea66019157abd992c8802564b675fd97420c01
Author:        Alasdair G Kergon <[email protected]>
AuthorDate:    Fri Jul 19 19:24:54 2013 +0100
Committer:     Alasdair G Kergon <[email protected]>
CommitterDate: Fri Jul 19 19:24:54 2013 +0100

commandline: add prefix aliases for raid options

Accept --raidwritemostly as well as --writemostly etc.

---
 WHATS_NEW          |    5 ++-
 tools/args.h       |    7 +++-
 tools/commands.h   |   88 ++++++++++++++++++++++++++-------------------------
 tools/lvmcmdline.c |    7 +++-
 4 files changed, 60 insertions(+), 47 deletions(-)
WHATS_NEW +3 -2
index 46d7d23..83a593e 100644
@@ -92,10 +92,11 @@ Version 2.02.99 -
   Add explicit message about unsupported pvmove for thin/thinpool volumes.
   Fix lvmetad error path in lvmetad_vg_lookup() for null vgname.
   Fix clvmd _cluster_request() return code in memory fail path.
-  Add writemostly/writebehind support for RAID1
+  Add lvcreate/lvchange --[raid]{min|max}recoveryrate for raid LVs.
+  Add lvchange --[raid]writemostly/writebehind support for RAID1
   Add lv_change_activate() for common activation code in vg/lvchange.
   Revert change that allowed identical table reload for RAID.
-  New lvchange arg, '--syncaction' allows scrubbing of RAID LVs.
+  Add lvchange --[raid]syncaction for scrubbing of RAID LVs.
   Improve RAID kernel status retrieval to include sync_action/mismatch_cnt.
   Add external origin support for lvcreate.
   Improve lvcreate, lvconvert and lvm man pages.
tools/args.h +6 -1
index bac507c..4b89ebd 100644
@@ -87,11 +87,16 @@ arg(ignoreadvanced_ARG, '\0', "ignoreadvanced", NULL, 0)
 arg(ignoreunsupported_ARG, '\0', "ignoreunsupported", NULL, 0)
 arg(atversion_ARG, '\0', "atversion", string_arg, 0)
 arg(validate_ARG, '\0', "validate", NULL, 0)
-arg(syncaction_ARG, '\0', "syncaction", string_arg, 0)
+arg(syncaction_ARG, '\0', "syncaction", string_arg, 0)	/* FIXME Use custom validation fn */
+arg(raidsyncaction_ARG, '\0', "raidsyncaction", string_arg, 0)
 arg(writemostly_ARG, '\0', "writemostly", string_arg, ARG_GROUPABLE)
+arg(raidwritemostly_ARG, '\0', "raidwritemostly", string_arg, ARG_GROUPABLE)
 arg(writebehind_ARG, '\0', "writebehind", int_arg, 0)
+arg(raidwritebehind_ARG, '\0', "raidwritebehind", int_arg, 0)
 arg(minrecoveryrate_ARG, '\0', "minrecoveryrate", size_kb_arg, 0)
+arg(raidminrecoveryrate_ARG, '\0', "raidminrecoveryrate", size_kb_arg, 0)
 arg(maxrecoveryrate_ARG, '\0', "maxrecoveryrate", size_kb_arg, 0)
+arg(raidmaxrecoveryrate_ARG, '\0', "raidmaxrecoveryrate", size_kb_arg, 0)
 arg(profile_ARG, '\0', "profile", string_arg, 0)
 arg(detachprofile_ARG, '\0', "detachprofile", NULL, 0)
 arg(mergedconfig_ARG, '\0', "mergedconfig", NULL, 0)
tools/commands.h +45 -43

184 lines not on this page · raw message

tools/lvmcmdline.c +6 -1
index 3aa4206..66c4536 100644
@@ -920,7 +920,12 @@ static int _get_settings(struct cmd_context *cmd)
 	    !_merge_synonym(cmd, allocation_ARG, allocatable_ARG) ||
 	    !_merge_synonym(cmd, allocation_ARG, resizeable_ARG) ||
 	    !_merge_synonym(cmd, virtualoriginsize_ARG, virtualsize_ARG) ||
-	    !_merge_synonym(cmd, available_ARG, activate_ARG))
+	    !_merge_synonym(cmd, available_ARG, activate_ARG) ||
+	    !_merge_synonym(cmd, raidsyncaction_ARG, syncaction_ARG) ||
+	    !_merge_synonym(cmd, raidwritemostly_ARG, writemostly_ARG) ||
+	    !_merge_synonym(cmd, raidminrecoveryrate_ARG, minrecoveryrate_ARG) ||
+	    !_merge_synonym(cmd, raidmaxrecoveryrate_ARG, maxrecoveryrate_ARG) ||
+	    !_merge_synonym(cmd, raidwritebehind_ARG, writebehind_ARG))
 		return EINVALID_CMD_LINE;
 
 	if ((!strncmp(cmd->command->name, "pv", 2) &&