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

Fix vgs to treat args as VGs even when PV fields are displayed.

This commit is contained in:
Alasdair Kergon 2007-01-27 02:09:06 +00:00
parent fce67134f3
commit 898b3d4d78
2 changed files with 28 additions and 5 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.21 -
===================================
Fix vgs to treat args as VGs even when PV fields are displayed.
Fix md signature check to handle both endiannesses.
Version 2.02.20 - 25th January 2007

View File

@ -138,6 +138,18 @@ out:
return ret;
}
static int _pvs_in_vg(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg, int consistent,
void *handle)
{
if (!vg) {
log_error("Volume group %s not found", vg_name);
return ECMD_FAILED;
}
return process_each_pv_in_vg(cmd, vg, NULL, handle, &_pvs_single);
}
static int _report(struct cmd_context *cmd, int argc, char **argv,
report_type_t report_type)
{
@ -146,8 +158,8 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
char *str;
const char *keys = NULL, *options = NULL, *separator;
int r = ECMD_PROCESSED;
int aligned, buffered, headings;
unsigned args_are_pvs;
aligned = find_config_tree_int(cmd, "report/aligned",
DEFAULT_REP_ALIGNED);
@ -158,6 +170,8 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
separator = find_config_tree_str(cmd, "report/separator",
DEFAULT_REP_SEPARATOR);
args_are_pvs = (report_type == PVS || report_type == PVSEGS) ? 1 : 0;
switch (report_type) {
case LVS:
keys = find_config_tree_str(cmd, "report/lvs_sort",
@ -292,16 +306,24 @@ static int _report(struct cmd_context *cmd, int argc, char **argv,
report_handle, &_vgs_single);
break;
case PVS:
r = process_each_pv(cmd, argc, argv, NULL, report_handle,
&_pvs_single);
if (args_are_pvs)
r = process_each_pv(cmd, argc, argv, NULL,
report_handle, &_pvs_single);
else
r = process_each_vg(cmd, argc, argv, LCK_VG_READ, 0,
report_handle, &_pvs_in_vg);
break;
case SEGS:
r = process_each_lv(cmd, argc, argv, LCK_VG_READ, report_handle,
&_lvsegs_single);
break;
case PVSEGS:
r = process_each_pv(cmd, argc, argv, NULL, report_handle,
&_pvsegs_single);
if (args_are_pvs)
r = process_each_pv(cmd, argc, argv, NULL,
report_handle, &_pvsegs_single);
else
r = process_each_vg(cmd, argc, argv, LCK_VG_READ, 0,
report_handle, &_pvs_in_vg);
break;
}