summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2019-12-11 12:56:15 -0600
committerDavid Teigland <teigland@redhat.com>2019-12-11 12:56:15 -0600
commit2173bdb82177fc687474b72561742955cb292522 (patch)
tree455329363daa1ad472f4aa11d2634a32bfc54327
parent2da6f01c1544a0b94bd06abc691fe0ac59268700 (diff)
downloadlvm2-2173bdb82177fc687474b72561742955cb292522.tar.gz
drop warnings about missing pvs in foreign vgs
When a foreign VG is ignored, don't print warnings that it is missing PVs.
-rw-r--r--lib/metadata/metadata.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 246682c6a..9c443882c 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -3564,7 +3564,8 @@ static void _set_pv_device(struct format_instance *fid,
if (!id_write_format(&pv->id, buffer, sizeof(buffer)))
buffer[0] = '\0';
- if (cmd && !cmd->pvscan_cache_single)
+ if (cmd && !cmd->pvscan_cache_single &&
+ (!vg_is_foreign(vg) && !cmd->include_foreign_vgs))
log_warn("WARNING: Couldn't find device with uuid %s.", buffer);
else
log_debug_metadata("Couldn't find device with uuid %s.", buffer);
@@ -5079,7 +5080,9 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, const
if (!pvl->pv->dev) {
/* The obvious and common case of a missing device. */
- if (pvl->pv->device_hint)
+ if (vg_is_foreign(vg) && !cmd->include_foreign_vgs)
+ log_debug("VG %s is missing PV %s (last written to %s)", vg_name, uuidstr, pvl->pv->device_hint ?: "na");
+ else if (pvl->pv->device_hint)
log_warn("WARNING: VG %s is missing PV %s (last written to %s).", vg_name, uuidstr, pvl->pv->device_hint);
else
log_warn("WARNING: VG %s is missing PV %s.", vg_name, uuidstr);