Skip to contentSkip to conversation

master - lvconvert: use command defs for mergemirrors

PATCH David Teigland 1 participant 1 message Feb 13, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=86d8ab493bbfbc0130a2bbe7717557ecc7fa33fd
Commit:        86d8ab493bbfbc0130a2bbe7717557ecc7fa33fd
Parent:        95e38607ecf44fece40dd4a1b078582554c93da1
Author:        David Teigland <[email protected]>
AuthorDate:    Fri Dec 9 14:39:57 2016 -0600
Committer:     David Teigland <[email protected]>
CommitterDate: Mon Feb 13 08:20:10 2017 -0600

lvconvert: use command defs for mergemirrors

and route the generic --merge to one of the
specific merge functions

---
 tools/args.h           |    1 +
 tools/command-lines.in |   54 ++++++++++++++---------------------
 tools/lvconvert.c      |   72 ++++++++++++++++++++++++++++++++++++++++++++++++
 tools/lvmcmdline.c     |   20 ++++++++-----
 tools/tools.h          |    4 ++
 5 files changed, 111 insertions(+), 40 deletions(-)
tools/args.h +1 -0
index c904609..559bf16 100644
@@ -60,6 +60,7 @@ arg(locktype_ARG, '\0', "locktype", locktype_VAL, 0, 0)
 arg(logonly_ARG, '\0', "logonly", 0, 0, 0)
 arg(maxrecoveryrate_ARG, '\0', "maxrecoveryrate", sizekb_VAL, 0, 0)
 arg(merge_ARG, '\0', "merge", 0, 0, 0)
+arg(mergemirrors_ARG, '\0', "mergemirrors", 0, 0, 0)
 arg(mergesnapshot_ARG, '\0', "mergesnapshot", 0, 0, 0)
 arg(mergethin_ARG, '\0', "mergethin", 0, 0, 0)
 arg(mergedconfig_ARG, '\0', "mergedconfig", 0, 0, 0)
tools/command-lines.in +22 -32

87 lines not on this page · raw message

tools/lvconvert.c +72 -0

75 lines not on this page · raw message

tools/lvmcmdline.c +12 -8
index 85fd1b8..c100311 100644
@@ -146,19 +146,23 @@ struct command_function command_functions[COMMAND_ID_COUNT] = {
 	{ lvconvert_merge_thin_CMD,			lvconvert_merge_thin_cmd },
 	{ lvconvert_split_and_keep_cachepool_CMD,	lvconvert_split_cachepool_cmd },
 	{ lvconvert_split_and_remove_cachepool_CMD,	lvconvert_split_cachepool_cmd },
-};
 
+	/* lvconvert utilities for raid/mirror */
+	{ lvconvert_merge_mirror_images_CMD,		lvconvert_merge_mirror_images_cmd },
 #if 0
-	/* all raid-related type conversions */
-	{ lvconvert_raid_types_CMD,			lvconvert_raid_types_fn },
+	{ lvconvert_split_mirror_images_CMD,		lvconvert_split_mirror_images_cmd },
+	{ lvconvert_change_mirrorlog_CMD,		lvconvert_change_mirrorlog_cmd },
+#endif
 
-	/* raid-related utilities (move into lvconvert_raid_types?) */
-	{ lvconvert_split_mirror_images_CMD,		lvconvert_split_mirror_images_fn },
-	{ lvconvert_change_mirrorlog_CMD,		lvconvert_change_mirrorlog_fn },
+	/* redirected to merge_snapshot/merge_thin/merge_mirrors */
+	{ lvconvert_merge_CMD, lvconvert_merge_cmd },
 
-	/* directed to one of the other merges (snap,thin,mirror) when all are implemented */
-	{ lvconvert_merge_CMD,				lvconvert_merge_fn },
+#if 0
+	/* all raid-related type conversions */
+	{ lvconvert_raid_types_CMD,			lvconvert_raid_types_cmd },
 #endif
+};
+
 
 /* Command line args */
 unsigned arg_count(const struct cmd_context *cmd, int a)
tools/tools.h +4 -0
index 2deded9..4bba46c 100644
@@ -271,4 +271,8 @@ int lvconvert_swap_pool_metadata_cmd(struct cmd_context *cmd, int argc, char **a
 int lvconvert_merge_thin_cmd(struct cmd_context *cmd, int argc, char **argv);
 int lvconvert_split_cachepool_cmd(struct cmd_context *cmd, int argc, char **argv);
 
+int lvconvert_merge_mirror_images_cmd(struct cmd_context *cmd, int argc, char **argv);
+
+int lvconvert_merge_cmd(struct cmd_context *cmd, int argc, char **argv);
+
 #endif