summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2016-02-25 14:12:08 -0600
committerDavid Teigland <teigland@redhat.com>2016-02-25 14:23:41 -0600
commit172bad0d5679f6152281cdd3a69e2cf0a3288c1e (patch)
tree704660c4cd9757ddd0230b18cabb2295b841e084
parent66e175702af4cfb1ecad9316a8151c001933c190 (diff)
downloadlvm2-172bad0d5679f6152281cdd3a69e2cf0a3288c1e.tar.gz
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".
-rw-r--r--lib/metadata/metadata.c5
-rw-r--r--lib/metadata/pv_manip.c6
-rw-r--r--test/shell/pv-ext-flags.sh2
-rw-r--r--test/shell/pvremove-usage.sh6
-rw-r--r--tools/pvchange.c2
-rw-r--r--tools/toollib.c12
6 files changed, 15 insertions, 18 deletions
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index acdfdecae..6ec0a0e2a 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 f54111c39..48706d106 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 cf2a8a1c8..d46549785 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 4fd26d1e1..e0f51bf1c 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 3c12c142a..86c4ac4f0 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 3e48139aa..80290302d 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);