master - man: use .HP instead of .TP
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=86a660be7b3180...
Commit: 86a660be7b31809500488792a93670a703e12a27
Parent: e13639053b0d413624fb10baab535fde2c2c5bd5
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Feb 20 17:10:11 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Feb 20 17:10:11 2017 -0600
man: use .HP instead of .TP
---
tools/command.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/tools/command.c b/tools/command.c
index b1fdc1b..fe8c1f6 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -2498,7 +2498,7 @@ void print_man_all_options_desc(struct command_name *cname)
if (!cname->all_options[opt_enum])
continue;
- printf("\n.TP\n");
+ printf("\n.HP\n");
if (opt_names[opt_enum].short_opt) {
printf("\\fB-%c\\fP|\\fB%s\\fP",
@@ -2591,7 +2591,7 @@ void print_man_all_positions_desc(struct command_name *cname)
}
if (has_vg_val) {
- printf("\n.TP\n");
+ printf("\n.HP\n");
printf("\\fI%s\\fP", val_names[vg_VAL].name);
printf("\n");
@@ -2605,7 +2605,7 @@ void print_man_all_positions_desc(struct command_name *cname)
}
if (has_lv_val) {
- printf("\n.TP\n");
+ printf("\n.HP\n");
printf("\\fI%s\\fP", val_names[lv_VAL].name);
printf("\n");
@@ -2619,7 +2619,7 @@ void print_man_all_positions_desc(struct command_name *cname)
}
if (has_pv_val) {
- printf("\n.TP\n");
+ printf("\n.HP\n");
printf("\\fI%s\\fP", val_names[pv_VAL].name);
printf("\n");
@@ -2632,7 +2632,7 @@ void print_man_all_positions_desc(struct command_name *cname)
}
if (has_tag_val) {
- printf("\n.TP\n");
+ printf("\n.HP\n");
printf("\\fI%s\\fP", val_names[tag_VAL].name);
printf("\n");
@@ -2642,7 +2642,7 @@ void print_man_all_positions_desc(struct command_name *cname)
}
if (has_select_val) {
- printf("\n.TP\n");
+ printf("\n.HP\n");
printf("\\fI%s\\fP", val_names[select_VAL].name);
printf("\n");
@@ -2654,7 +2654,7 @@ void print_man_all_positions_desc(struct command_name *cname)
/* Every command uses a string arg somewhere. */
- printf("\n.TP\n");
+ printf("\n.HP\n");
printf("\\fI%s\\fP", val_names[string_VAL].name);
printf("\n");
printf(".br\n");
@@ -2662,7 +2662,7 @@ void print_man_all_positions_desc(struct command_name *cname)
/* Nearly every command uses a number arg somewhere. */
- printf("\n.TP\n");
+ printf("\n.HP\n");
printf("\\fINumber\\fP, \\fISize\\fP");
printf("\n");
printf(".br\n");
@@ -2671,7 +2671,7 @@ void print_man_all_positions_desc(struct command_name *cname)
"The default input unit is specified by letter, followed by |unit which\n"
"represents other possible input units: bBsSkKmMgGtTpPeE.\n");
- printf("\n.TP\n");
+ printf("\n.HP\n");
printf("Environment");
printf("\n");
printf(".br\n");
7 years, 2 months
master - man/help: print general raid type as "raid"
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e13639053b0d41...
Commit: e13639053b0d413624fb10baab535fde2c2c5bd5
Parent: d22cccdf631576d4fd0504ffd17812d778f9d37b
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Feb 20 15:41:24 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Feb 20 15:41:24 2017 -0600
man/help: print general raid type as "raid"
Instead of printing "raid*". There are already
notes mentioning that "raid" refers to "raid<N>"
---
tools/vals.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/vals.h b/tools/vals.h
index 88c446e..4dc3a61 100644
--- a/tools/vals.h
+++ b/tools/vals.h
@@ -123,7 +123,7 @@ val(numsignedper_VAL, int_arg_with_sign_and_percent, "SNumberP", "[+|-]Number[%V
val(permission_VAL, permission_arg, "Permission", "rw|r")
val(metadatatype_VAL, metadatatype_arg, "MetadataType", "lvm2|lvm1")
val(units_VAL, string_arg, "Units", "r|R|h|H|b|B|s|S|k|K|m|M|g|G|t|T|p|P|e|E")
-val(segtype_VAL, segtype_arg, "SegType", "linear|striped|snapshot|mirror|raid*|thin|cache|thin-pool|cache-pool")
+val(segtype_VAL, segtype_arg, "SegType", "linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool")
val(alloc_VAL, alloc_arg, "Alloc", "contiguous|cling|cling_by_tags|normal|anywhere|inherit")
val(locktype_VAL, locktype_arg, "LockType", "sanlock|dlm|none")
val(readahead_VAL, readahead_arg, "Readahead", "auto|none|NumberSectors")
7 years, 2 months
master - man vgchange/lvchange: note special option usage
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d22cccdf631576...
Commit: d22cccdf631576d4fd0504ffd17812d778f9d37b
Parent: a2d2cd8777ea0f387383743ba2739007ef1b3baf
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Feb 20 15:26:24 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Feb 20 15:36:30 2017 -0600
man vgchange/lvchange: note special option usage
---
tools/command-lines.in | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/command-lines.in b/tools/command-lines.in
index 092f941..606d2e7 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -250,7 +250,9 @@ OO_LVCHANGE_META: --addtag Tag, --deltag Tag,
lvchange OO_LVCHANGE_META VG|LV|Tag|Select ...
OO: --activate Active, OO_LVCHANGE
ID: lvchange_properties
-DESC: Change a general LV property.
+DESC: Change a general LV attribute.
+DESC: For options listed in parentheses, any one is
+DESC: required, after which the others are optional.
RULE: all not lv_is_pvmove lv_is_mirror_log lv_is_mirror_image
RULE: all and lv_is_vg_writable
RULE: --contiguous not --alloc
@@ -1408,7 +1410,9 @@ vgchange OO_VGCHANGE_META
OO: OO_VGCHANGE
OP: VG|Tag|Select ...
ID: vgchange_properties
-DESC: Change a general VG property.
+DESC: Change a general VG attribute.
+DESC: For options listed in parentheses, any one is
+DESC: required, after which the others are optional.
vgchange --monitor Bool
OO: --sysinit, --ignorelockingfailure, --poll Bool, OO_VGCHANGE
7 years, 2 months
master - man lvcreate: add special option notes at the start
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a2d2cd8777ea0f...
Commit: a2d2cd8777ea0f387383743ba2739007ef1b3baf
Parent: 2396c506890e62da5d13c4f3bcd1f715272ab382
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Feb 20 15:17:10 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Feb 20 15:36:30 2017 -0600
man lvcreate: add special option notes at the start
The --name, --size, --extents options deserve a special
note at the start of the man page, before appearing in
the usage section.
---
man/lvcreate.8.des | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/man/lvcreate.8.des b/man/lvcreate.8.des
index e18affe..488dab4 100644
--- a/man/lvcreate.8.des
+++ b/man/lvcreate.8.des
@@ -26,3 +26,14 @@ virtual size rather than a physical size. A cache LV is the combination of
a standard LV with a cache pool, used to cache active portions of the LV
to improve performance.
+.SS Usage notes
+
+In the usage section below, \fB--size\fP \fINumber\fP can be replaced
+in each case with \fB--extents\fP \fINumberExtents\fP. Also see both
+descriptions the options section.
+
+In the usage section below, \fB--name\fP is omitted from the required
+options, even though it is typically used. When the name is not
+specified, a new LV name is generated with the "lvol" prefix and a unique
+numeric suffix. Also see the description in the options section.
+
7 years, 2 months
master - man: add variables descriptions
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2396c506890e62...
Commit: 2396c506890e62da5d13c4f3bcd1f715272ab382
Parent: 4d29d9afb21a4571b45fe18d16cc4b57cd7ec187
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Feb 20 15:09:02 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Feb 20 15:36:10 2017 -0600
man: add variables descriptions
Add a section describing variables.
In the full options list, include common
options in the alphabetical listing instead
of at the end.
---
tools/command.c | 172 ++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 152 insertions(+), 20 deletions(-)
diff --git a/tools/command.c b/tools/command.c
index 06dcc77..b1fdc1b 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -2484,35 +2484,20 @@ void print_man_all_options_list(struct command_name *cname)
/*
* All options used for a given command name, along with descriptions.
* listed in order of:
- * 1. options that are not common to all lvm commands, alphabetically
- * 2. options common to all lvm commands, alphabetically
*/
void print_man_all_options_desc(struct command_name *cname)
{
int opt_enum, val_enum;
- int print_common = 0;
int sep = 0;
int i;
- again:
- /*
- * Loop 1: print options that are not common to all lvm commands.
- * Loop 2: print options common to all lvm commands (lvm_all)
- */
-
for (i = 0; i < ARG_COUNT; i++) {
opt_enum = opt_names_alpha[i]->opt_enum;
if (!cname->all_options[opt_enum])
continue;
- if (!print_common && is_lvm_all_opt(opt_enum))
- continue;
-
- if (print_common && !is_lvm_all_opt(opt_enum))
- continue;
-
printf("\n.TP\n");
if (opt_names[opt_enum].short_opt) {
@@ -2545,11 +2530,153 @@ void print_man_all_options_desc(struct command_name *cname)
sep = 1;
}
+}
- if (!print_common) {
- print_common = 1;
- goto again;
+void print_man_all_positions_desc(struct command_name *cname)
+{
+ struct command *cmd;
+ int ci, rp, op;
+ int has_vg_val = 0;
+ int has_lv_val = 0;
+ int has_pv_val = 0;
+ int has_tag_val = 0;
+ int has_select_val = 0;
+ int has_lv_type = 0;
+
+ for (ci = 0; ci < COMMAND_COUNT; ci++) {
+ cmd = &commands[ci];
+
+ if (strcmp(cmd->name, cname->name))
+ continue;
+
+ for (rp = 0; rp < cmd->rp_count; rp++) {
+ if (cmd->required_pos_args[rp].def.val_bits & val_enum_to_bit(vg_VAL))
+ has_vg_val = 1;
+
+ if (cmd->required_pos_args[rp].def.val_bits & val_enum_to_bit(lv_VAL)) {
+ has_lv_val = 1;
+ if (cmd->required_pos_args[rp].def.lvt_bits)
+ has_lv_type = 1;
+ }
+
+ if (cmd->required_pos_args[rp].def.val_bits & val_enum_to_bit(pv_VAL))
+ has_pv_val = 1;
+
+ if (cmd->required_pos_args[rp].def.val_bits & val_enum_to_bit(tag_VAL))
+ has_tag_val = 1;
+
+ if (cmd->required_pos_args[rp].def.val_bits & val_enum_to_bit(select_VAL))
+ has_select_val = 1;
+ }
+
+ for (op = 0; op < cmd->op_count; op++) {
+ if (cmd->optional_pos_args[op].def.val_bits & val_enum_to_bit(vg_VAL))
+ has_vg_val = 1;
+
+ if (cmd->optional_pos_args[op].def.val_bits & val_enum_to_bit(lv_VAL)) {
+ has_lv_val = 1;
+ if (cmd->optional_pos_args[op].def.lvt_bits)
+ has_lv_type = 1;
+ }
+
+ if (cmd->optional_pos_args[op].def.val_bits & val_enum_to_bit(pv_VAL))
+ has_pv_val = 1;
+
+ if (cmd->optional_pos_args[op].def.val_bits & val_enum_to_bit(tag_VAL))
+ has_tag_val = 1;
+
+ if (cmd->optional_pos_args[op].def.val_bits & val_enum_to_bit(select_VAL))
+ has_select_val = 1;
+ }
+ }
+
+ if (has_vg_val) {
+ printf("\n.TP\n");
+
+ printf("\\fI%s\\fP", val_names[vg_VAL].name);
+ printf("\n");
+ printf(".br\n");
+ printf("Volume Group name. See \\fBlvm\\fP(8) for valid names.\n");
+
+ if (!strcmp(cname->name, "lvcreate"))
+ printf("For lvcreate, the required VG positional arg may be\n"
+ "omitted when the VG name is included in another option,\n"
+ "e.g. --name VG/LV.\n");
}
+
+ if (has_lv_val) {
+ printf("\n.TP\n");
+
+ printf("\\fI%s\\fP", val_names[lv_VAL].name);
+ printf("\n");
+ printf(".br\n");
+ printf("Logical Volume name. See \\fBlvm\\fP(8) for valid names.\n"
+ "An LV positional arg generally includes the VG name and LV name, e.g. VG/LV.\n");
+
+ if (has_lv_type)
+ printf("LV followed by _<type> indicates that an LV of the\n"
+ "given type is required. (raid represents raid<N> type)\n");
+ }
+
+ if (has_pv_val) {
+ printf("\n.TP\n");
+
+ printf("\\fI%s\\fP", val_names[pv_VAL].name);
+ printf("\n");
+ printf(".br\n");
+ printf("Physical Volume name, a device path under /dev.\n"
+ "For commands managing physical extents, a PV positional arg\n"
+ "generally accepts a suffix indicating a range of physical extents.\n"
+ "Start and end range (inclusive): \\fIPV\\fP[:\\fIPE\\fP[-\\fIPE\\fP].\n"
+ "Start and length range (counting from 0): \\fIPV\\fP[:\\fIPE\\fP[+\\fIPE\\fP].\n");
+ }
+
+ if (has_tag_val) {
+ printf("\n.TP\n");
+
+ printf("\\fI%s\\fP", val_names[tag_VAL].name);
+ printf("\n");
+ printf(".br\n");
+ printf("Tag name. See \\fBlvm\\fP(8) for information about tag names and using tags\n"
+ "in place of a VG, LV or PV.\n");
+ }
+
+ if (has_select_val) {
+ printf("\n.TP\n");
+
+ printf("\\fI%s\\fP", val_names[select_VAL].name);
+ printf("\n");
+ printf(".br\n");
+ printf("Select indicates that a required positional parameter can\n"
+ "be omitted if the \\fB--select\\fP option is used.\n"
+ "No arg appears in this position.\n");
+ }
+
+ /* Every command uses a string arg somewhere. */
+
+ printf("\n.TP\n");
+ printf("\\fI%s\\fP", val_names[string_VAL].name);
+ printf("\n");
+ printf(".br\n");
+ printf("See the option description for information about the string content.\n");
+
+ /* Nearly every command uses a number arg somewhere. */
+
+ printf("\n.TP\n");
+ printf("\\fINumber\\fP, \\fISize\\fP");
+ printf("\n");
+ printf(".br\n");
+ printf("Input units are always treated as base two values, regardless of unit\n"
+ "capitalization, e.g. 'k' and 'K' both refer to 1024.\n"
+ "The default input unit is specified by letter, followed by |unit which\n"
+ "represents other possible input units: bBsSkKmMgGtTpPeE.\n");
+
+ printf("\n.TP\n");
+ printf("Environment");
+ printf("\n");
+ printf(".br\n");
+ printf("See \\fBlvm\\fP(8) for information about environment variables used by lvm.\n"
+ "For example, LVM_VG_NAME can generally be substituted for a required VG parameter.\n");
}
void print_desc_man(const char *desc)
@@ -2641,7 +2768,7 @@ void print_man(char *name, char *des_file, int include_primary, int include_seco
cname = find_command_name(name);
- printf(".TH %s 8 \"LVM TOOLS #VERSION#\" \"Sistina Software UK\"\n",
+ printf(".TH %s 8 \"LVM TOOLS #VERSION#\" \"Red Hat, Inc.\"\n",
upper_command_name(lvmname));
for (i = 0; i < COMMAND_COUNT; i++) {
@@ -2657,6 +2784,9 @@ void print_man(char *name, char *des_file, int include_primary, int include_seco
printf(".SH OPTIONS\n");
printf(".br\n");
print_man_all_options_desc(cname);
+ printf(".SH VARIABLES\n");
+ printf(".br\n");
+ print_man_all_positions_desc(cname);
prev_cmd = NULL;
}
@@ -2752,7 +2882,9 @@ void print_man(char *name, char *des_file, int include_primary, int include_seco
printf(".SH OPTIONS\n");
printf(".br\n");
print_man_all_options_desc(cname);
-
+ printf(".SH VARIABLES\n");
+ printf(".br\n");
+ print_man_all_positions_desc(cname);
}
printf("\n");
7 years, 2 months
master - lvresize/lvextend: accept type option
by David Teigland
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4d29d9afb21a45...
Commit: 4d29d9afb21a4571b45fe18d16cc4b57cd7ec187
Parent: 5f2639d01d8e1ac6e95ad7855abb93b5cd260a22
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Mon Feb 20 11:23:46 2017 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Mon Feb 20 11:23:46 2017 -0600
lvresize/lvextend: accept type option
The --type option has previously been accepted for
lvresize/lvextend. Using it did not affect the operation
of the command. The value was simply verified as matching
the current seg type of the LV.
---
tools/command-lines.in | 29 ++++++++++++++++++++++-------
1 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/tools/command-lines.in b/tools/command-lines.in
index aed38e7..092f941 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -1126,12 +1126,17 @@ ID: lvdisplay_general
---
+# --type is an option in lvextend/lvresize only so that the specified type
+# value can be checked to match the existing type; using it doesn't
+# currently enable any different behavior.
+
# --extents is not specified; it's an automatic alternative for --size
lvextend --size SizeMB LV
OO: --alloc Alloc, --autobackup Bool, --force, --mirrors SNumber,
--nofsck, --nosync, --noudevsync, --reportformat ReportFmt, --resizefs,
---stripes Number, --stripesize SizeKB, --poolmetadatasize SizeMB
+--stripes Number, --stripesize SizeKB, --poolmetadatasize SizeMB,
+--type SegType
OP: PV ...
ID: lvextend_by_size
DESC: Extend an LV by a specified size.
@@ -1139,7 +1144,8 @@ DESC: Extend an LV by a specified size.
lvextend LV PV ...
OO: --alloc Alloc, --autobackup Bool, --force, --mirrors SNumber,
--nofsck, --nosync, --noudevsync,
---reportformat ReportFmt, --resizefs, --stripes Number, --stripesize SizeKB
+--reportformat ReportFmt, --resizefs, --stripes Number, --stripesize SizeKB,
+--type SegType
ID: lvextend_by_pv
DESC: Extend an LV by specified PV extents.
FLAGS: SECONDARY_SYNTAX
@@ -1147,7 +1153,8 @@ FLAGS: SECONDARY_SYNTAX
lvextend --poolmetadatasize SizeMB LV_thinpool
OO: --alloc Alloc, --autobackup Bool, --force, --mirrors SNumber,
--nofsck, --nosync, --noudevsync,
---reportformat ReportFmt, --stripes Number, --stripesize SizeKB
+--reportformat ReportFmt, --stripes Number, --stripesize SizeKB,
+--type SegType
OP: PV ...
ID: lvextend_pool_metadata_by_size
DESC: Extend a pool metadata SubLV by a specified size.
@@ -1155,7 +1162,8 @@ DESC: Extend a pool metadata SubLV by a specified size.
lvextend --usepolicies LV_thinpool_snapshot
OO: --alloc Alloc, --autobackup Bool, --force, --mirrors SNumber,
--nofsck, --nosync, --noudevsync,
---reportformat ReportFmt, --resizefs
+--reportformat ReportFmt, --resizefs,
+--type SegType
OP: PV ...
ID: lvextend_by_policy
DESC: Extend an LV according to a predefined policy.
@@ -1193,10 +1201,15 @@ ID: lvrename_lv_lv
---
+# --type is an option in lvextend/lvresize only so that the specified type
+# value can be checked to match the existing type; using it doesn't
+# currently enable any different behavior.
+
lvresize --size SizeMB LV
OO: --alloc Alloc, --autobackup Bool, --force,
--nofsck, --nosync, --noudevsync, --reportformat ReportFmt, --resizefs,
---stripes Number, --stripesize SizeKB, --poolmetadatasize SizeMB
+--stripes Number, --stripesize SizeKB, --poolmetadatasize SizeMB,
+--type SegType
OP: PV ...
ID: lvresize_by_size
DESC: Resize an LV by a specified size.
@@ -1204,7 +1217,8 @@ DESC: Resize an LV by a specified size.
lvresize LV PV ...
OO: --alloc Alloc, --autobackup Bool, --force,
--nofsck, --nosync, --noudevsync,
---reportformat ReportFmt, --resizefs, --stripes Number, --stripesize SizeKB
+--reportformat ReportFmt, --resizefs, --stripes Number, --stripesize SizeKB,
+--type SegType
ID: lvresize_by_pv
DESC: Resize an LV by specified PV extents.
FLAGS: SECONDARY_SYNTAX
@@ -1212,7 +1226,8 @@ FLAGS: SECONDARY_SYNTAX
lvresize --poolmetadatasize SizeMB LV_thinpool
OO: --alloc Alloc, --autobackup Bool, --force,
--nofsck, --nosync, --noudevsync,
---reportformat ReportFmt, --stripes Number, --stripesize SizeKB
+--reportformat ReportFmt, --stripes Number, --stripesize SizeKB,
+--type SegType
OP: PV ...
ID: lvresize_pool_metadata_by_size
DESC: Resize a pool metadata SubLV by a specified size.
7 years, 2 months
master - tests: update lvresize testing
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5f2639d01d8e1a...
Commit: 5f2639d01d8e1ac6e95ad7855abb93b5cd260a22
Parent: 13dd1ca757ab861bcd8f761f60e3c17384ae6326
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Feb 19 22:59:21 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 20 00:44:12 2017 +0100
tests: update lvresize testing
Add missing tests for some lvresize acceptable options.
---
test/shell/lvresize-usage.sh | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvresize-usage.sh b/test/shell/lvresize-usage.sh
index a136147..35f6e57 100644
--- a/test/shell/lvresize-usage.sh
+++ b/test/shell/lvresize-usage.sh
@@ -34,9 +34,26 @@ lvremove -ff $vg
lvcreate -L 10M -n lv $vg "$dev1"
lvextend -L +10M $vg/lv "$dev2"
+lvextend --type striped -m0 -L +10M $vg/lv "$dev2"
# Attempt to reduce with lvextend and vice versa:
not lvextend -L 16M $vg/lv
not lvreduce -L 32M $vg/lv
lvremove -ff $vg
+
+lvcreate --type mirror -L 4 -n $lv1 $vg
+# Incorrent name for resized LV
+not lvextend --type mirror -L 10 -n $lv1 $vg
+# Same size
+not lvextend --type mirror -L 4 $vg/$lv1
+# Cannot use any '-' or '+' sign for --mirror arg
+not lvextend --type mirror -L+2 -m-1 $vg/$lv1
+not lvextend --type mirror -L+2 -m+1 $vg/$lv1
+
+lvextend --type mirror -L+4 -m1 $vg/$lv1
+
+lvs -a $vg
+check lv_field $vg/$lv1 size "8.00m"
+
+lvremove -ff $vg
7 years, 2 months
master - cleanup: simplier code
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=13dd1ca757ab86...
Commit: 13dd1ca757ab861bcd8f761f60e3c17384ae6326
Parent: 2260c6d1e6c9b6332bf24e4237258e92543ce37f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 18 19:46:22 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 20 00:43:40 2017 +0100
cleanup: simplier code
Already know string is 'lvm-' so use name[3].
---
tools/command.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/tools/command.c b/tools/command.c
index f99d025..06dcc77 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -2635,8 +2635,7 @@ void print_man(char *name, char *des_file, int include_primary, int include_seco
int i;
if (!strncmp(name, "lvm-", 4)) {
- char *space = strchr(lvmname, '-');
- *space = ' ';
+ name[3] = ' ';
name += 4;
}
7 years, 2 months
master - cleanup: same sign for compare
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2260c6d1e6c9b6...
Commit: 2260c6d1e6c9b6332bf24e4237258e92543ce37f
Parent: d8514b24e115f4c45fb7b6263f553a30e776a3da
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 18 19:45:17 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 20 00:43:40 2017 +0100
cleanup: same sign for compare
---
tools/command.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/tools/command.c b/tools/command.c
index f46fb3d..f99d025 100644
--- a/tools/command.c
+++ b/tools/command.c
@@ -912,8 +912,6 @@ static void update_prev_opt_arg(struct command *cmd, char *str, int required)
cmd->optional_opt_args[cmd->oo_count-1].def = def;
else if (required < 0)
cmd->ignore_opt_args[cmd->io_count-1].def = def;
- else
- return;
}
/*
@@ -1529,7 +1527,7 @@ static void _print_usage_description(struct command *cmd)
{
const char *desc = cmd->desc;
char buf[MAX_LINE] = {0};
- int di = 0;
+ unsigned di = 0;
int bi = 0;
for (di = 0; di < strlen(desc); di++) {
7 years, 2 months
master - cleanup: use multiline string
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d8514b24e115f4...
Commit: d8514b24e115f4c45fb7b6263f553a30e776a3da
Parent: aff62c74b7b947d19dda7f03e79d0f2437ad4730
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sat Feb 18 19:09:24 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Feb 20 00:43:40 2017 +0100
cleanup: use multiline string
---
tools/lvmcmdline.c | 50 +++++++++++++++++++++++++-------------------------
1 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index e796873..9fa8d94 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -1684,30 +1684,30 @@ static void _usage_notes(void)
* [ ] for optional, ... for repeatable, | for one of the following,
* -- for an option name, lower case strings and digits for literals.
*/
- log_print("Usage notes:");
- log_print(". Variable parameters are: Number, String, PV, VG, LV, Tag.");
- log_print(". Select indicates that a required positional parameter can");
- log_print(" be omitted if the --select option is used.");
- log_print(". --size Number can be replaced with --extents NumberExtents.");
- log_print(". When --name is omitted from lvcreate, a new LV name is");
- log_print(" generated with the \"lvol\" prefix and a unique numeric suffix.");
- log_print(". The required VG parameter in lvcreate may be omitted when");
- log_print(" the VG name is included in another option, e.g. --name VG/LV.");
- log_print(". For required options listed in parentheses, e.g. (--A, --B),");
- log_print(" any one is required, after which the others are optional.");
- log_print(". The _new suffix indicates the VG or LV must not yet exist.");
- log_print(". LV followed by _<type> indicates that an LV of the given type");
- log_print(" is required. (raid represents any raid<N> type.)");
- log_print(". Input units are always treated as base two values, regardless of");
- log_print(" unit capitalization, e.g. 'k' and 'K' both refer to 1024.");
- log_print(". The default input unit is specified by letter, followed by |unit");
- log_print(" which represents other possible input units: bBsSkKmMgGtTpPeE.");
- log_print(". Output units can be specified with the --units option, for which");
- log_print(" lower/upper case letters refer to base 2/10 values.");
- log_print(" formats that are recognized, e.g. for compatibility.");
- log_print(". See man pages for short option equivalents of long option names,");
- log_print(" and for more detailed descriptions of variable parameters.");
- log_print(" ");
+ log_print("Usage notes:\n"
+ ". Variable parameters are: Number, String, PV, VG, LV, Tag.\n"
+ ". Select indicates that a required positional parameter can\n"
+ " be omitted if the --select option is used.\n"
+ ". --size Number can be replaced with --extents NumberExtents.\n"
+ ". When --name is omitted from lvcreate, a new LV name is\n"
+ " generated with the \"lvol\" prefix and a unique numeric suffix.\n"
+ ". The required VG parameter in lvcreate may be omitted when\n"
+ " the VG name is included in another option, e.g. --name VG/LV.\n"
+ ". For required options listed in parentheses, e.g. (--A, --B),\n"
+ " any one is required, after which the others are optional.\n"
+ ". The _new suffix indicates the VG or LV must not yet exist.\n"
+ ". LV followed by _<type> indicates that an LV of the given type\n"
+ " is required. (raid represents any raid<N> type.)\n"
+ ". Input units are always treated as base two values, regardless of\n"
+ " unit capitalization, e.g. 'k' and 'K' both refer to 1024.\n"
+ ". The default input unit is specified by letter, followed by |unit\n"
+ " which represents other possible input units: bBsSkKmMgGtTpPeE.\n"
+ ". Output units can be specified with the --units option, for which\n"
+ " lower/upper case letters refer to base 2/10 values.\n"
+ " formats that are recognized, e.g. for compatibility.\n"
+ ". See man pages for short option equivalents of long option names,\n"
+ " and for more detailed descriptions of variable parameters.\n"
+ " \n");
}
static int _usage(const char *name, int longhelp)
@@ -3285,6 +3285,6 @@ int lvm2_main(int argc, char **argv)
out:
lvm_fin(cmd);
+
return lvm_return_code(ret);
}
-
7 years, 2 months