1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00

copy vgid only when volume group is present in import_pool_pv

This commit is contained in:
Zdeněk Kabeláč 2008-06-11 13:14:41 +00:00
parent a090f7b839
commit ba7ae0002e
2 changed files with 3 additions and 2 deletions

View File

@ -225,7 +225,7 @@ static int _pool_pv_read(const struct format_type *fmt, const char *pv_name,
if (!(pl = read_pool_disk(fmt, dev, mem, NULL)))
goto_out;
if (!import_pool_pv(fmt, fmt->cmd->mem, fmt->orphan_vg_name, pv, pl))
if (!import_pool_pv(fmt, fmt->cmd->mem, NULL, pv, pl))
goto_out;
pv->fmt = fmt;

View File

@ -165,7 +165,8 @@ int import_pool_pv(const struct format_type *fmt, struct dm_pool *mem,
log_error("Unable to duplicate vg_name string");
return 0;
}
memcpy(&pv->vgid, &vg->id, sizeof(vg->id));
if (vg != NULL)
memcpy(&pv->vgid, &vg->id, sizeof(vg->id));
pv->status = 0;
pv->size = pd->pl_blocks;
pv->pe_size = POOL_PE_SIZE;