1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

vgdisplay: add command def for activevolumegroups

This variant does not accecpt positional args like
the others.
This commit is contained in:
David Teigland 2024-12-05 15:55:26 -06:00
parent 017c668fd0
commit 6c5e8ee18b
4 changed files with 20 additions and 12 deletions

View File

@ -1882,17 +1882,25 @@ ID: vgdisplay_columns
DESC: Display output in columns like vgs.
vgdisplay --colon
OO: OO_REPORTING, --activevolumegroups
OO: OO_REPORTING
OP: VG|Tag ...
IO: --partial, --ignoreskippedcluster
ID: vgdisplay_colon
DESC: Generate colon separated output.
vgdisplay
OO: OO_REPORTING, --activevolumegroups, --short
OO: OO_REPORTING, --short
OP: VG|Tag ...
IO: --partial, --ignoreskippedcluster
ID: vgdisplay_general
DESC: Display Volume Groups.
vgdisplay --activevolumegroups
OO: OO_REPORTING, --short, --colon
IO: --partial, --ignoreskippedcluster
ID: vgdisplay_active
RULE: --short not --colon
DESC: Display Volume Groups with active LVs.
---

View File

@ -101,6 +101,7 @@ static const struct command_function _command_functions[CMD_COUNT] = {
/* vgdisplay variants */
{ vgdisplay_columns_CMD, vgdisplay_columns_cmd },
{ vgdisplay_colon_CMD, vgdisplay_colon_cmd },
{ vgdisplay_active_CMD, vgdisplay_active_cmd },
{ vgdisplay_general_CMD, vgdisplay_general_cmd },
/* lvconvert utilities related to repair. */

View File

@ -196,6 +196,7 @@ int pvdisplay_cmd(struct cmd_context *cmd, int argc, char **argv);
int vgdisplay_columns_cmd(struct cmd_context *cmd, int argc, char **argv);
int vgdisplay_colon_cmd(struct cmd_context *cmd, int argc, char **argv);
int vgdisplay_general_cmd(struct cmd_context *cmd, int argc, char **argv);
int vgdisplay_active_cmd(struct cmd_context *cmd, int argc, char **argv);
int lvconvert_repair_cmd(struct cmd_context *cmd, int argc, char **argv);
int lvconvert_replace_pv_cmd(struct cmd_context *cmd, int argc, char **argv);

View File

@ -59,24 +59,22 @@ static int _vgdisplay_general_single(struct cmd_context *cmd, const char *vg_nam
int vgdisplay_colon_cmd(struct cmd_context *cmd, int argc, char **argv)
{
if (argc && arg_is_set(cmd, activevolumegroups_ARG)) {
log_error("Option -A is not allowed with volume group names");
return EINVALID_CMD_LINE;
}
return process_each_vg(cmd, argc, argv, NULL, NULL, 0, 0, NULL, _vgdisplay_colon_single);
}
int vgdisplay_general_cmd(struct cmd_context *cmd, int argc, char **argv)
{
if (argc && arg_is_set(cmd, activevolumegroups_ARG)) {
log_error("Option -A is not allowed with volume group names");
return EINVALID_CMD_LINE;
}
return process_each_vg(cmd, argc, argv, NULL, NULL, 0, 0, NULL, _vgdisplay_general_single);
}
int vgdisplay_active_cmd(struct cmd_context *cmd, int argc, char **argv)
{
if (arg_is_set(cmd, colon_ARG))
return process_each_vg(cmd, argc, argv, NULL, NULL, 0, 0, NULL, _vgdisplay_colon_single);
else
return process_each_vg(cmd, argc, argv, NULL, NULL, 0, 0, NULL, _vgdisplay_general_single);
}
int vgdisplay_columns_cmd(struct cmd_context *cmd, int argc, char **argv)
{
return vgs(cmd, argc, argv);