summaryrefslogtreecommitdiff
path: root/tools/lvmcmdline.c
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2022-09-09 16:07:07 -0500
committerDavid Teigland <teigland@redhat.com>2022-09-09 16:18:55 -0500
commit18722dfdf4d3e6f172d0b2af8bbdc4a154ea1dc0 (patch)
treed6e85ac7c07e5d225372f1e169540e0cc6d0fdf5 /tools/lvmcmdline.c
parent55e9494e5fe3e3d2790fca6330b848a577e0b1c0 (diff)
downloadlvm2-18722dfdf4d3e6f172d0b2af8bbdc4a154ea1dc0.tar.gz
lvresize: restructure code
Rewrite top level resize function to prepare for adding new fs resizing.
Diffstat (limited to 'tools/lvmcmdline.c')
-rw-r--r--tools/lvmcmdline.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index ba3ca220b..a5bb6a5c5 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -165,6 +165,16 @@ static const struct command_function _command_functions[CMD_COUNT] = {
{ pvscan_display_CMD, pvscan_display_cmd },
{ pvscan_cache_CMD, pvscan_cache_cmd },
+
+ /* lvextend/lvreduce/lvresize */
+ { lvextend_policy_CMD, lvextend_policy_cmd },
+ { lvextend_pool_metadata_CMD, lvresize_cmd },
+ { lvresize_pool_metadata_CMD, lvresize_cmd },
+ { lvextend_pv_CMD, lvresize_cmd },
+ { lvresize_pv_CMD, lvresize_cmd },
+ { lvextend_size_CMD, lvresize_cmd },
+ { lvreduce_size_CMD, lvresize_cmd },
+ { lvresize_size_CMD, lvresize_cmd },
};
@@ -3153,6 +3163,9 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
if (!(cmd->command = _find_command(cmd, cmd->name, &argc, argv)))
return EINVALID_CMD_LINE;
+ /* avoid this by letting lib code use cmd->command */
+ cmd->command_enum = cmd->command->command_enum;
+
/*
* If option --foo is set which is listed in IO (ignore option) in
* command-lines.in, then unset foo. Commands won't usually use an