Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=abd9618dd8b77ca1…
Commit: abd9618dd8b77ca1974074ae76fa6a08f1a687d9
Parent: a68e601886e1c9b78345b4c33ce366451e2fe184
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Feb 25 20:40:28 2016 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Feb 25 23:30:24 2016 +0100
lvconvert: fix vg parameter
Since we want to read env LVM_VG_NAME vg names,
we cannot just check LV names which do contain '/'.
So before the patch commands like:
> lvconvert --repair vg
Before:
Please provide a valid volume group name
After:
Path required for Logical Volume "vg".
Please provide a valid volume group name
> LVM_VG_NAME=vg lvconvert --repair vg
Before:
Please provide a valid volume group name
After:
Can't find LV vg in VG vg
---
WHATS_NEW | 1 +
tools/lvconvert.c | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 524fea4..250f3f1 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.144 -
=====================================
+ Improve support for env LVM_VG_NAME for reference VG name in lvconvert.
Fix regresion when lvresize accepted zero sizes (2.02.141).
Always warn user about PV in use even when pvremove uses --force --force.
Use uninitilized pool header detection in all cases.
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
index e7394c0..3ec6d59 100644
--- a/tools/lvconvert.c
+++ b/tools/lvconvert.c
@@ -173,8 +173,7 @@ static int _lvconvert_name_params(struct lvconvert_params *lp,
if (!validate_restricted_lvname_param(cmd, &lp->vg_name, &lp->lv_split_name))
return_0;
- if (strchr(lp->lv_name_full, '/') &&
- (vg_name = extract_vgname(cmd, lp->lv_name_full)) &&
+ if ((vg_name = extract_vgname(cmd, lp->lv_name_full)) &&
lp->vg_name && strcmp(vg_name, lp->vg_name)) {
log_error("Please use a single volume group name "
"(\"%s\" or \"%s\")", vg_name, lp->vg_name);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=172bad0d5679f615…
Commit: 172bad0d5679f6152281cdd3a69e2cf0a3288c1e
Parent: 66e175702af4cfb1ecad9316a8151c001933c190
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Feb 25 14:12:08 2016 -0600
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Feb 25 14:23:41 2016 -0600
Use a common message for a used PV
Change some inconsistent messages and adopt
the new wording "PV %s is used by" in place
of "PV %s is marked as belonging to"
or "PV %s belongs to".
---
lib/metadata/metadata.c | 5 ++---
lib/metadata/pv_manip.c | 6 ++----
test/shell/pv-ext-flags.sh | 2 +-
test/shell/pvremove-usage.sh | 6 +++---
tools/pvchange.c | 2 +-
tools/toollib.c | 12 ++++++------
6 files changed, 15 insertions(+), 18 deletions(-)
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index acdfdec..6ec0a0e 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -201,8 +201,7 @@ static int add_pv_to_vg(struct volume_group *vg, const char *pv_name,
return_0;
if (used) {
- log_error("Physical volume '%s' is marked as belonging to a VG "
- "but its metadata is missing.", pv_name);
+ log_error("PV %s is used by a VG but its metadata is missing.", pv_name);
return 0;
}
}
@@ -1585,7 +1584,7 @@ static int _pvcreate_check(struct cmd_context *cmd, const char *name,
goto_out;
if (used && pp->force != DONT_PROMPT_OVERRIDE) {
- log_error("PV '%s' is marked as belonging to a VG but its metadata is missing.", name);
+ log_error("PV %s is used by a VG but its metadata is missing.", name);
log_error("Can't initialize PV '%s' without -ff.", name);
goto out;
}
diff --git a/lib/metadata/pv_manip.c b/lib/metadata/pv_manip.c
index f54111c..48706d1 100644
--- a/lib/metadata/pv_manip.c
+++ b/lib/metadata/pv_manip.c
@@ -733,8 +733,7 @@ static int pvremove_check(struct cmd_context *cmd, const char *name,
goto_out;
if (used) {
- log_warn("WARNING: PV '%s' is marked as belonging to a VG "
- "but its metadata is missing.", name);
+ log_warn("WARNING: PV %s is used by a VG but its metadata is missing.", name);
if (force_count < 2)
goto_bad;
@@ -745,8 +744,7 @@ static int pvremove_check(struct cmd_context *cmd, const char *name,
goto_bad;
}
} else {
- log_warn("WARNING: PV %s belongs to Volume Group %s "
- "(consider using vgreduce).", name, pv_vg_name(pv));
+ log_warn("WARNING: PV %s is used by VG %s (consider using vgreduce).", name, pv_vg_name(pv));
if (force_count < 2)
goto_bad;
diff --git a/test/shell/pv-ext-flags.sh b/test/shell/pv-ext-flags.sh
index cf2a8a1..d465497 100644
--- a/test/shell/pv-ext-flags.sh
+++ b/test/shell/pv-ext-flags.sh
@@ -17,7 +17,7 @@ SKIP_WITH_LVMPOLLD=1
aux prepare_devs 2
# PV_EXT_USED flag
-MARKED_AS_USED_MSG="marked as belonging to a VG but its metadata is missing"
+MARKED_AS_USED_MSG="is used by a VG but its metadata is missing"
######################################
### CHECK PV WITH 0 METADATA AREAS ###
diff --git a/test/shell/pvremove-usage.sh b/test/shell/pvremove-usage.sh
index 4fd26d1..e0f51bf 100644
--- a/test/shell/pvremove-usage.sh
+++ b/test/shell/pvremove-usage.sh
@@ -56,16 +56,16 @@ for mdacp in 0 1 2; do
# pvremove -f fails when pv in a vg (---metadatacopies $mdacp)
not pvremove -f "$dev1" 2>&1 | tee out
- grep "belongs" out
+ grep "is used" out
pvs "$dev1"
# pvremove -ff fails without confirmation when pv in a vg (---metadatacopies $mdacp)
not pvremove -ff "$dev1" 2>&1 | tee out
- grep "belongs" out
+ grep "is used" out
# pvremove -ff succeds with confirmation when pv in a vg (---metadatacopies $mdacp)
pvremove -ffy "$dev1" 2>&1 | tee out
- grep "belongs" out
+ grep "is used" out
not pvs "$dev1"
vgreduce --removemissing $vg
diff --git a/tools/pvchange.c b/tools/pvchange.c
index 3c12c14..86c4ac4 100644
--- a/tools/pvchange.c
+++ b/tools/pvchange.c
@@ -60,7 +60,7 @@ static int _pvchange_single(struct cmd_context *cmd, struct volume_group *vg,
goto_bad;
if (used && (arg_count(cmd, force_ARG) != DONT_PROMPT_OVERRIDE)) {
- log_error("PV '%s' is marked as belonging to a VG but its metadata is missing.", pv_name);
+ log_error("PV %s is used by a VG but its metadata is missing.", pv_name);
log_error("Can't change PV '%s' without -ff.", pv_name);
goto bad;
}
diff --git a/tools/toollib.c b/tools/toollib.c
index 3e48139..8029030 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -2962,7 +2962,7 @@ static int _process_pvs_in_vg(struct cmd_context *cmd,
pv_name = pv_dev_name(pv);
if (cmd->system_id && is_orphan(pv) && is_used_pv(pv)) {
- log_verbose("PV %s is marked as belonging to a VG but its metadata is missing.", pv_name);
+ log_verbose("PV %s is used by a VG but its metadata is missing.", pv_name);
log_verbose("Skipping PV %s because it's not possible to decide whether it matches system id.", pv_name);
continue;
}
@@ -3601,7 +3601,7 @@ static void _check_pvcreate_prompt(struct cmd_context *cmd,
prompt->answer = PROMPT_ANSWER_NO;
if (prompt->vg_name_unknown) {
- log_error("PV '%s' is marked as belonging to a VG but its metadata is missing.", pvname);
+ log_error("PV %s is used by a VG but its metadata is missing.", pvname);
log_error("Can't initialize PV '%s' without -ff.", pvname);
} else if (!strcmp(command_name(cmd), "pvcreate")) {
log_error("Can't initialize physical volume \"%s\" of volume group \"%s\" without -ff", pvname, vgname);
@@ -3626,15 +3626,15 @@ static void _check_pvcreate_prompt(struct cmd_context *cmd,
prompt->answer = PROMPT_ANSWER_NO;
if (prompt->vg_name_unknown)
- log_error("PV %s belongs to a VG but its metadata is missing.", pvname);
+ log_error("PV %s is used by a VG but its metadata is missing.", pvname);
else
- log_error("PV %s belongs to Volume Group %s so please use vgreduce first.", pvname, vgname);
+ log_error("PV %s is used by VG %s so please use vgreduce first.", pvname, vgname);
log_error("(If you are certain you need pvremove, then confirm by using --force twice.)");
} else if (pp->yes) {
- log_warn("WARNING: PV %s belongs to Volume Group %s", pvname, vgname);
+ log_warn("WARNING: PV %s is used by VG %s", pvname, vgname);
prompt->answer = PROMPT_ANSWER_YES;
} else if (ask) {
- log_warn("WARNING: PV %s belongs to Volume Group %s", pvname, vgname);
+ log_warn("WARNING: PV %s is used by VG %s", pvname, vgname);
if (yes_no_prompt("Really WIPE LABELS from physical volume \"%s\" of volume group \"%s\" [y/n]? ", pvname, vgname) == 'n') {
prompt->answer = PROMPT_ANSWER_NO;
log_error("%s: physical volume label not removed", pvname);
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=79f259621542e62a…
Commit: 79f259621542e62a2f9fb5982f473d2bb849b1b5
Parent: 3d3b132d9ac845e31c316ad4b908466bb3837a4d
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Thu Feb 18 16:52:37 2016 +0000
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Thu Feb 25 16:40:59 2016 +0000
tests: add simple dmstats report tests
Add tests for the "dmstats report" command:
* report
* report --count
* report --histogram
So far the tests just check the command runs as expected when a
correctly configured stats region exists: validation of output
can be added later.
---
test/shell/dmstats-report.sh | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/test/shell/dmstats-report.sh b/test/shell/dmstats-report.sh
new file mode 100644
index 0000000..c36e3eb
--- /dev/null
+++ b/test/shell/dmstats-report.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Copyright (C) 2009-2011 Red Hat, Inc. All rights reserved.
+#
+# 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 General Public License v.2.
+#
+# You should have received a copy of the GNU 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
+
+. lib/inittest
+
+# ensure we can create devices (uses dmsetup, etc)
+aux prepare_devs 1
+
+# prepare a stats region with a histogram
+dmstats create --bounds 10ms,20ms,30ms "$dev1"
+
+# basic dmstats report commands
+dmstats report
+dmstats report --count 1
+dmstats report --histogram
+