master - lvconvert: repair and replace: use command definitions
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=35b9d4d6e9406396c90a75574f04a7018f3d6258 Commit: 35b9d4d6e9406396c90a75574f04a7018f3d6258 Parent: 52c60b7e7bba400b2f8fb40f123ca90224c16d27 Author: David Teigland <[email protected]> AuthorDate: Thu Nov 17 15:38:52 2016 -0600 Committer: David Teigland <[email protected]> CommitterDate: Mon Feb 13 08:20:10 2017 -0600
lvconvert: repair and replace: use command definitions
This lifts the lvconvert --repair and --replace commands out of the monolithic lvconvert implementation. The previous calls into repair/replace can no longer be reached and will be removed in a separate commit.
--- tools/command-lines.in | 2 +- tools/lvconvert.c | 337 +++++++++++++++++++++++++++++++++++++++++++++-- tools/lvmcmdline.c | 6 +- tools/tools.h | 3 + 4 files changed, 330 insertions(+), 18 deletions(-)
tools/command-lines.in +1 -1
@@ -547,7 +547,7 @@ DESC: Combine LV with a previously split snapshot LV. # and the LV type is known. lvconvert --repair LV_raid_mirror_thinpool -OO: --usepolicies, OO_LVCONVERT +OO: --usepolicies, --interval Number, OO_LVCONVERT OP: PV ... ID: lvconvert_repair_pvs_or_thinpool DESC: Replace failed PVs in a raid or mirror LV.
tools/lvconvert.c +322 -15
420 lines not on this page · raw message
tools/lvmcmdline.c +4 -2
@@ -122,6 +122,10 @@ struct command_function command_functions[COMMAND_ID_COUNT] = { { lvchange_monitor_CMD, lvchange_monitor_poll_cmd }, { lvchange_poll_CMD, lvchange_monitor_poll_cmd }, { lvchange_persistent_CMD, lvchange_persistent_cmd }, + +/* lvconvert utilities related to snapshots and repair. */ + { lvconvert_repair_pvs_or_thinpool_CMD, lvconvert_repair_pvs_or_thinpool_cmd }, + { lvconvert_replace_pv_CMD, lvconvert_replace_pv_cmd }, };#if 0 /* all raid-related type conversions */
@@ -147,8 +151,6 @@ struct command_function command_functions[COMMAND_ID_COUNT] = { { lvconvert_merge_CMD, lvconvert_merge_fn }, { lvconvert_combine_split_snapshot_CMD, lvconvert_combine_split_snapshot_fn }, - { lvconvert_repair_pvs_or_thinpool_CMD, lvconvert_repair_pvs_or_thinpool_fn }, - { lvconvert_replace_pv_CMD, lvconvert_replace_pv_fn }, { lvconvert_split_cow_snapshot_CMD, lvconvert_split_cow_snapshot_fn }, { lvconvert_poll_start_CMD, lvconvert_poll_start_fn },
tools/tools.h +3 -0
@@ -251,4 +251,7 @@ int lvchange_rebuild_cmd(struct cmd_context *cmd, int argc, char **argv);int lvchange_monitor_poll_cmd (struct cmd_context *cmd,int argc,char **argv);int lvchange_persistent_cmd (struct cmd_context *cmd,int argc,char **argv); +int lvconvert_repair_pvs_or_thinpool_cmd (struct cmd_context *cmd,int argc,char **argv); +int lvconvert_replace_pv_cmd (struct cmd_context *cmd,int argc,char **argv); +#endif