master - tools: Add internal hosttags command.
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7a9e7a57e37d6fbab2dcd3c03192fd092811756f Commit: 7a9e7a57e37d6fbab2dcd3c03192fd092811756f Parent: e833d84e67f62b9be4f5900381f6e32c4ecf66ca Author: Alasdair G Kergon <[email protected]> AuthorDate: Thu Jan 30 12:06:15 2014 +0000 Committer: Alasdair G Kergon <[email protected]> CommitterDate: Thu Jan 30 12:06:15 2014 +0000
tools: Add internal hosttags command.
lib/display/display.c +9 -0
@@ -912,6 +912,15 @@ void display_formats(const struct cmd_context *cmd) } } +void display_hosttags (const struct cmd_context *cmd) +{ +const struct str_list *sl; + + dm_list_iterate_items(sl, &cmd->tags) { +log_print ("%s" , sl->str); + } +} +void display_segtypes (const struct cmd_context *cmd) {const struct segment_type *segtype;
lib/display/display.h +1 -0
@@ -52,6 +52,7 @@ void vgdisplay_colons(const struct volume_group *vg);void vgdisplay_short (const struct volume_group *vg);void display_formats (const struct cmd_context *cmd); +void display_hosttags (const struct cmd_context *cmd);void display_segtypes (const struct cmd_context *cmd);void display_name_error (name_error_t name_error);
man/lvm.8.in +2 -0
@@ -52,6 +52,8 @@ loading \fBlvm.conf\fP(5) and any other configuration files. .TP \fBhelp\fP \(em Display the help text. .TP +\fBhosttags\fP \(em Display any tags defined on this host. +.TP \fBpvdata\fP \(em Not implemented in LVM2. .TP \fBsegtypes\fP \(em Display recognised Logical Volume segment types.
tools/Makefile.in +2 -1
@@ -19,6 +19,7 @@ top_builddir = @top_builddir@ SOURCES =\ dumpconfig.c \ formats.c \ + hosttags.c \ lvchange.c \ lvconvert.c \ lvcreate.c \
@@ -166,7 +167,7 @@ liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION): liblvm2cmd.$(LIB_SUFFIX) .commands: $(srcdir)/commands.h $(srcdir)/cmdnames.h Makefile $(CC) -E -P $(srcdir)/cmdnames.h 2> /dev/null | \ - egrep -v '^ *(|#.*|devtypes|dumpconfig|formats|help|pvdata|segtypes|version) *$$' > .commands + egrep -v '^ *(|#.*|devtypes|dumpconfig|formats|help|hosttags|pvdata|segtypes|version) *$$' > .commands ifneq ("$(CFLOW_CMD)", "") CFLOW_SOURCES = $(addprefix $(srcdir)/, $(SOURCES))
tools/commands.h +5 -0
@@ -80,6 +80,11 @@ xx(help, PERMITTED_READ_ONLY, "help <command>" "\n") +xx (hosttags, +"List tags defined on this host" , +PERMITTED_READ_ONLY , +"hosttags\n" ) +/********* xx(lvactivate, "Activate logical volume on given partition(s)",
tools/hosttags.c new file +23 -0
@@ -0,0 +1,23 @@ +/* +* Copyright (C) 2014 Red Hat, Inc. All rights reserved. +* +* This file is part of LVM2. +* +* This copyrighted material is made available to anyone wishing to use, +* modify, copy, or redistribute it subject to the terms and conditions +* of the GNU Lesser General Public License v.2.1. +* +* You should have received a copy of the GNU Lesser General Public License +* along with this program; if not, write to the Free Software Foundation, +* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "tools.h" + +int hosttags (struct cmd_context *cmd,int argc __attribute__((unused)), +char **argv __attribute__((unused))) +{ +display_hosttags (cmd); + +return ECMD_PROCESSED ; +}
--- lib/display/display.c | 9 +++++++++ lib/display/display.h | 1 + man/lvm.8.in | 2 ++ tools/Makefile.in | 3 ++- tools/commands.h | 5 +++++ 5 files changed, 19 insertions(+), 1 deletions(-)
lib/display/display.c +9 -0
@@ -912,6 +912,15 @@ void display_formats(const struct cmd_context *cmd) } } +void display_hosttags (const struct cmd_context *cmd) +{ +const struct str_list *sl; + + dm_list_iterate_items(sl, &cmd->tags) { +log_print ("%s" , sl->str); + } +} +void display_segtypes (const struct cmd_context *cmd) {const struct segment_type *segtype;
lib/display/display.h +1 -0
@@ -52,6 +52,7 @@ void vgdisplay_colons(const struct volume_group *vg);void vgdisplay_short (const struct volume_group *vg);void display_formats (const struct cmd_context *cmd); +void display_hosttags (const struct cmd_context *cmd);void display_segtypes (const struct cmd_context *cmd);void display_name_error (name_error_t name_error);
man/lvm.8.in +2 -0
@@ -52,6 +52,8 @@ loading \fBlvm.conf\fP(5) and any other configuration files. .TP \fBhelp\fP \(em Display the help text. .TP +\fBhosttags\fP \(em Display any tags defined on this host. +.TP \fBpvdata\fP \(em Not implemented in LVM2. .TP \fBsegtypes\fP \(em Display recognised Logical Volume segment types.
tools/Makefile.in +2 -1
@@ -19,6 +19,7 @@ top_builddir = @top_builddir@ SOURCES =\ dumpconfig.c \ formats.c \ + hosttags.c \ lvchange.c \ lvconvert.c \ lvcreate.c \
@@ -166,7 +167,7 @@ liblvm2cmd.$(LIB_SUFFIX).$(LIB_VERSION): liblvm2cmd.$(LIB_SUFFIX) .commands: $(srcdir)/commands.h $(srcdir)/cmdnames.h Makefile $(CC) -E -P $(srcdir)/cmdnames.h 2> /dev/null | \ - egrep -v '^ *(|#.*|devtypes|dumpconfig|formats|help|pvdata|segtypes|version) *$$' > .commands + egrep -v '^ *(|#.*|devtypes|dumpconfig|formats|help|hosttags|pvdata|segtypes|version) *$$' > .commands ifneq ("$(CFLOW_CMD)", "") CFLOW_SOURCES = $(addprefix $(srcdir)/, $(SOURCES))
tools/commands.h +5 -0
@@ -80,6 +80,11 @@ xx(help, PERMITTED_READ_ONLY, "help <command>" "\n") +xx (hosttags, +"List tags defined on this host" , +PERMITTED_READ_ONLY , +"hosttags\n" ) +/********* xx(lvactivate, "Activate logical volume on given partition(s)",