struct physical_volume *pv,
struct volume_group *vg)
{
+ int r;
struct pvcreate_restorable_params rp = {.restorefile = NULL,
.id = {{0}},
.idp = NULL,
.extent_count = 0,
.extent_size = vg->extent_size};
- return _format1_pv_initialise(fmt, -1, 0, 0, &rp, pv);
+ if ((r = _format1_pv_initialise(fmt, -1, 0, 0, &rp, pv)))
+ pv->status |= ALLOCATABLE_PV;
+
+ return r;
}
static int _format1_lv_setup(struct format_instance *fid, struct logical_volume *lv)
log_verbose("Removing physical volume \"%s\" from "
"volume group \"%s\"", pv_dev_name(pv), vg->name);
pv->vg_name = vg->fid->fmt->orphan_vg_name;
- pv->status = ALLOCATABLE_PV;
+ pv->status &= ~ALLOCATABLE_PV;
if (!dev_get_size(pv_dev(pv), &pv->size)) {
log_error("%s: Couldn't get size.", pv_dev_name(pv));