1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-04 09:18:36 +03:00

drop warnings about missing pvs in foreign vgs

When a foreign VG is ignored, don't print warnings that
it is missing PVs.
This commit is contained in:
David Teigland 2019-12-11 12:56:15 -06:00
parent 2da6f01c15
commit 2173bdb821

View File

@ -3564,7 +3564,8 @@ static void _set_pv_device(struct format_instance *fid,
if (!id_write_format(&pv->id, buffer, sizeof(buffer))) if (!id_write_format(&pv->id, buffer, sizeof(buffer)))
buffer[0] = '\0'; 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); log_warn("WARNING: Couldn't find device with uuid %s.", buffer);
else else
log_debug_metadata("Couldn't find device with uuid %s.", buffer); 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) { if (!pvl->pv->dev) {
/* The obvious and common case of a missing device. */ /* 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); log_warn("WARNING: VG %s is missing PV %s (last written to %s).", vg_name, uuidstr, pvl->pv->device_hint);
else else
log_warn("WARNING: VG %s is missing PV %s.", vg_name, uuidstr); log_warn("WARNING: VG %s is missing PV %s.", vg_name, uuidstr);