dev-dct-process-latest - tools: common handling of --persistent option
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f09f85d027d8833727483efd6077f52d2e5b6ba2 Commit: f09f85d027d8833727483efd6077f52d2e5b6ba2 Parent: 73f4fa6bc100e21562397627ea95a5e89443c1ab Author: Zdenek Kabelac <[email protected]> AuthorDate: Fri Sep 19 14:57:02 2014 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Fri Sep 19 15:54:20 2014 +0200
tools: common handling of --persistent option
Move common code for reading and processing of --persistent arguments for lvcreate and lvchange into lvmcmdline.
Reuse validate_major_minor() routine for validation.
Don't blindly activate LVs after change in cluster and instead only local reactivation is supported. (we have now many limited targets now).
Dropping 'sigint_caught()' handling, since prompt() is resolving this case itself.
--- WHATS_NEW | 1 + tools/lvchange.c | 103 +++++++++++++++++++++++----------------------------- tools/lvcreate.c | 59 ++++++------------------------ tools/lvmcmdline.c | 61 +++++++++++++++++++++---------- tools/tools.h | 5 ++- 5 files changed, 103 insertions(+), 126 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.112 - ===================================== + Unify handling of --persistent option for lvcreate and lvchange. Validate major and minor numbers stored in metadata. Use -fPIE when linking -pie executables. Enable cache segment type by default.
tools/lvchange.c +45 -58
131 lines not on this page · raw message
tools/lvcreate.c +12 -47
81 lines not on this page · raw message
tools/lvmcmdline.c +42 -19
74 lines not on this page · raw message
tools/tools.h +3 -2
@@ -138,8 +138,9 @@ int segtype_arg(struct cmd_context *cmd, struct arg_values *av);int alloc_arg (struct cmd_context *cmd,struct arg_values *av);int readahead_arg (struct cmd_context *cmd,struct arg_values *av);int metadatacopies_arg (struct cmd_context *cmd __attribute__((unused)),struct arg_values *av); -int major_minor_valid (const struct cmd_context * cmd,const struct format_type *fmt, -int32_t major,int32_t minor); +int read_and_validate_major_minor (const struct cmd_context *cmd, +const struct format_type *fmt, +int32_t *major,int32_t *minor);/* we use the enums to access the switches */ unsigned arg_count (const struct cmd_context *cmd,int a);