mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-22 06:50:52 +03:00
Fix vgimport fix to work outside debug mode.
This commit is contained in:
parent
239f422039
commit
9f85f61010
lib
@ -255,14 +255,15 @@ static int _read_extents(struct disk_list *data)
|
||||
/*
|
||||
* If exported, remove "PV_EXP" from end of VG name
|
||||
*/
|
||||
void munge_exported_vg(struct pv_disk *pvd, struct vg_disk *vgd)
|
||||
void munge_exported_vg(struct pv_disk *pvd)
|
||||
{
|
||||
int l;
|
||||
size_t s;
|
||||
|
||||
/* Return if PV not in a VG or VG not exported */
|
||||
if ((!*pvd->vg_name) || (vgd && !(vgd->vg_status & VG_EXPORTED)))
|
||||
/* Return if PV not in a VG */
|
||||
if ((!*pvd->vg_name))
|
||||
return;
|
||||
/* FIXME also check vgd->status & VG_EXPORTED? */
|
||||
|
||||
l = strlen(pvd->vg_name);
|
||||
s = sizeof(EXPORTED_TAG);
|
||||
@ -296,7 +297,7 @@ static struct disk_list *__read_disk(const struct format_type *fmt,
|
||||
}
|
||||
|
||||
/* If VG is exported, set VG name back to the real name */
|
||||
munge_exported_vg(&dl->pvd, &dl->vgd);
|
||||
munge_exported_vg(&dl->pvd);
|
||||
|
||||
if (!(info = lvmcache_add(fmt->labeller, dl->pvd.pv_uuid, dev,
|
||||
dl->pvd.vg_name, NULL)))
|
||||
|
@ -224,7 +224,7 @@ int export_uuids(struct disk_list *dl, struct volume_group *vg);
|
||||
void export_numbers(struct list *pvds, struct volume_group *vg);
|
||||
|
||||
void export_pv_act(struct list *pvds);
|
||||
void munge_exported_vg(struct pv_disk *pvd, struct vg_disk *vgd);
|
||||
void munge_exported_vg(struct pv_disk *pvd);
|
||||
|
||||
/* blech */
|
||||
int get_free_vg_number(struct format_instance *fid, struct dev_filter *filter,
|
||||
|
@ -51,7 +51,7 @@ static int _read(struct labeller *l, struct device *dev, char *buf,
|
||||
struct pv_disk *pvd = (struct pv_disk *) buf;
|
||||
struct lvmcache_info *info;
|
||||
|
||||
munge_exported_vg(pvd, NULL);
|
||||
munge_exported_vg(pvd);
|
||||
if (!(info = lvmcache_add(l, pvd->pv_uuid, dev, pvd->vg_name, NULL)))
|
||||
return 0;
|
||||
*label = info->label;
|
||||
|
@ -666,7 +666,7 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vgname,
|
||||
|
||||
if ((correct_vg->status & PVMOVE) && !pvmove_mode()) {
|
||||
log_error("WARNING: Interrupted pvmove detected in "
|
||||
"volume group %s", vg->name);
|
||||
"volume group %s", correct_vg->name);
|
||||
log_error("Please restore the metadata by running "
|
||||
"vgcfgrestore.");
|
||||
return NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user