1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

copy vgid only when volume group is present in import_pool_pv

This commit is contained in:
Zdenek Kabelac 2008-06-11 13:14:41 +00:00
parent d47bc3821c
commit 25a9fda4f6
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))) if (!(pl = read_pool_disk(fmt, dev, mem, NULL)))
goto_out; 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; goto_out;
pv->fmt = fmt; pv->fmt = fmt;

View File

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