fmt->ops = &_format1_ops;
fmt->name = FMT_LVM1_NAME;
fmt->alias = NULL;
- fmt->features = FMT_RESTRICTED_LVIDS;
+ fmt->features = FMT_RESTRICTED_LVIDS | FMT_ORPHAN_ALLOCATABLE;
fmt->private = NULL;
if (!(fmt->labeller = lvm1_labeller_create(fmt))) {
#define FMT_TAGS 0x00000004 /* Tagging? */
#define FMT_UNLIMITED_VOLS 0x00000008 /* Unlimited PVs/LVs? */
#define FMT_RESTRICTED_LVIDS 0x00000010 /* LVID <= 255 */
+#define FMT_ORPHAN_ALLOCATABLE 0x00000020 /* Orphan PV allocatable? */
typedef enum {
ALLOC_DEFAULT,
}
+ if (!*pv->vg_name &&
+ !(pv->fmt->features & FMT_ORPHAN_ALLOCATABLE)) {
+ log_error("Allocatability not supported by orphan "
+ "%s format PV %s", pv->fmt->name, pv_name);
+ unlock_vg(cmd, ORPHAN);
+ return 0;
+ }
+
/* change allocatability for a PV */
if (allocatable && (pv->status & ALLOCATABLE_PV)) {
log_error("Physical volume \"%s\" is already allocatable",