{
struct physical_volume *pv;
- pv = pv_by_path(vg->fid->fmt->cmd, pv_name);
+ if (!(pv = pv_by_path(vg->fid->fmt->cmd, pv_name)))
+ stack;
if (!pv && !pp) {
log_error("%s not identified as an existing "
"physical volume", pv_name);
return 0;
} else if (!pv && pp) {
- pv = pvcreate_single(vg->cmd, pv_name, pp, 0);
- if (!pv)
- return 0;
+ if (!(pv = pvcreate_single(vg->cmd, pv_name, pp, 0)))
+ return_0;
}
if (!add_pv_to_vg(vg, pv_name, pv, pp)) {
free_pv_fid(pv);
- return 0;
+ return_0;
}
return 1;
}
char *pv_name;
if (_vg_bad_status_bits(vg, RESIZEABLE_VG))
- return 0;
+ return_0;
/* attach each pv */
for (i = 0; i < pv_count; i++) {
/* FIXME Check partition type is LVM unless --force is given */
/* Is there a pv here already? */
- pv = pv_read(cmd, name, 0, 0);
+ if (!(pv = pv_read(cmd, name, 0, 0)))
+ stack;
/*
* If a PV has no MDAs it may appear to be an orphan until the
free_pv_fid(pv);
if (!scan_vgs_for_pvs(cmd, 0))
return_0;
- pv = pv_read(cmd, name, 0, 0);
+ if (!(pv = pv_read(cmd, name, 0, 0)))
+ stack;
}
/* Allow partial & exported VGs to be destroyed. */
goto_bad;
log_error("uuid %s already in use on \"%s\"", buffer,
dev_name(dev));
- goto bad;;
+ goto bad;
}
}
if (!(pv = _pv_read(b->vg->cmd, b->vg->vgmem, dev_name(lvmcache_device(info)),
b->vg->fid, b->warnings, 0))) {
+ stack;
return 1;
}