From 156dd4f1ecefade7ac92c67a5de7d449dbf32edc Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Tue, 14 Sep 2004 16:42:46 +0000 Subject: [PATCH] New commands 'segtypes' and 'formats'. --- WHATS_NEW | 1 + lib/display/display.c | 19 +++++++++++++++++++ lib/display/display.h | 3 +++ tools/Makefile.in | 2 ++ tools/commands.h | 8 ++++++++ 5 files changed, 33 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index 010b1c444..ce8c4b88e 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.00.23 - ==================================== + New commands 'segtypes' and 'formats'. Suppress pvmove abort message in test mode. Improve pvcreate/remove device not found error message. Allow pvmove to move data within the same PV. diff --git a/lib/display/display.c b/lib/display/display.c index fcb453ca7..5da2ddc1a 100644 --- a/lib/display/display.c +++ b/lib/display/display.c @@ -662,3 +662,22 @@ void vgdisplay_short(struct volume_group *vg) SIZE_SHORT)); return; } + +void display_formats(struct cmd_context *cmd) +{ + struct format_type *fmt; + + list_iterate_items(fmt, &cmd->formats) { + log_print("%s", fmt->name); + } +} + +void display_segtypes(struct cmd_context *cmd) +{ + struct segment_type *segtype; + + list_iterate_items(segtype, &cmd->segtypes) { + log_print("%s", segtype->name); + } +} + diff --git a/lib/display/display.h b/lib/display/display.h index 0fc3486ff..fbd7b2663 100644 --- a/lib/display/display.h +++ b/lib/display/display.h @@ -45,6 +45,9 @@ void vgdisplay_full(struct volume_group *vg); void vgdisplay_colons(struct volume_group *vg); void vgdisplay_short(struct volume_group *vg); +void display_formats(struct cmd_context *cmd); +void display_segtypes(struct cmd_context *cmd); + /* * Allocation policy display conversion routines. */ diff --git a/tools/Makefile.in b/tools/Makefile.in index d7c58abcb..ce8ff2036 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -23,6 +23,7 @@ endif SOURCES =\ archiver.c \ dumpconfig.c \ + formats.c \ lvchange.c \ lvcreate.c \ lvdisplay.c \ @@ -43,6 +44,7 @@ SOURCES =\ pvremove.c \ pvscan.c \ reporter.c \ + segtypes.c \ toollib.c \ vgcfgbackup.c \ vgcfgrestore.c \ diff --git a/tools/commands.h b/tools/commands.h index 902850088..2293fbcb2 100644 --- a/tools/commands.h +++ b/tools/commands.h @@ -32,6 +32,10 @@ xx(dumpconfig, "Dump active configuration", "dumpconfig \n") +xx(formats, + "List available metadata formats", + "formats\n") + xx(help, "Display help for commands", "help " "\n") @@ -513,6 +517,10 @@ xx(pvscan, exported_ARG, ignorelockingfailure_ARG, novolumegroup_ARG, partial_ARG, short_ARG, uuid_ARG) +xx(segtypes, + "List available segment types", + "segtypes\n") + xx(vgcfgbackup, "Backup volume group configuration(s)", "vgcfgbackup " "\n"