Start by using it in a comment for a missing PV.
struct physical_volume *pv;
struct pv_list *pvl;
const struct dm_config_value *cv;
+ const char *device_hint;
uint64_t size, ba_start;
if (!(pvl = dm_pool_zalloc(mem, sizeof(*pvl))) ||
return 0;
}
+ if (dm_config_get_str(pvn, "device", &device_hint)) {
+ if (!(pv->device_hint = dm_pool_strdup(mem, device_hint)))
+ log_error("Failed to allocate memory for device hint in read_pv.");
+ }
+
if (!_read_uint64(pvn, "pe_start", &pv->pe_start)) {
log_error("Couldn't read extent start value (pe_start) "
"for physical volume.");
if (!pvl->pv->dev) {
/* The obvious and common case of a missing device. */
- log_warn("WARNING: VG %s is missing PV %s.", vg_name, uuidstr);
+ 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);
missing_pv_dev++;
} else if (pvl->pv->status & MISSING_PV) {
struct id id;
struct id old_id; /* Set during pvchange -u. */
struct device *dev;
+ const char *device_hint; /* primary name last time metadata was written */
const struct format_type *fmt;
struct format_instance *fid;