diff --git a/lib/format_text/export.c b/lib/format_text/export.c index b6aac456b..73030e4f9 100644 --- a/lib/format_text/export.c +++ b/lib/format_text/export.c @@ -418,6 +418,10 @@ static int _print_vg(struct formatter *f, struct volume_group *vg) outf(f, "allocation_policy = \"%s\"", get_alloc_string(vg->alloc)); } + + if (vg->profile) + outf(f, "profile = \"%s\"", vg->profile->name); + outf(f, "metadata_copies = %u", vg->mda_copies); return 1; @@ -623,6 +627,9 @@ static int _print_lv(struct formatter *f, struct logical_volume *lv) outf(f, "allocation_policy = \"%s\"", get_alloc_string(lv->alloc)); + if (lv->profile) + outf(f, "profile = \"%s\"", lv->profile->name); + switch (lv->read_ahead) { case DM_READ_AHEAD_NONE: outfc(f, "# None", "read_ahead = -1"); diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index a5b9b6c11..b2106033c 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -2411,7 +2411,7 @@ struct format_type *create_text_format(struct cmd_context *cmd) fmt->orphan_vg_name = ORPHAN_VG_NAME(FMT_TEXT_NAME); fmt->features = FMT_SEGMENTS | FMT_MDAS | FMT_TAGS | FMT_PRECOMMIT | FMT_UNLIMITED_VOLS | FMT_RESIZE_PV | - FMT_UNLIMITED_STRIPESIZE | FMT_BAS; + FMT_UNLIMITED_STRIPESIZE | FMT_BAS | FMT_CONFIG_PROFILE; if (!(mda_lists = dm_malloc(sizeof(struct mda_lists)))) { log_error("Failed to allocate dir_list"); diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index c9af654b5..76660aeaf 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -4651,6 +4651,9 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l status, lp->alloc, vg))) return_NULL; + if (vg->fid->fmt->features & FMT_CONFIG_PROFILE) + lv->profile = vg->cmd->profile_params->global_profile; + if (lp->read_ahead != lv->read_ahead) { log_verbose("Setting read ahead sectors"); lv->read_ahead = lp->read_ahead; diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 98216d4d9..50d9d2cab 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -112,6 +112,7 @@ #define FMT_UNLIMITED_STRIPESIZE 0x00000100U /* Unlimited stripe size? */ #define FMT_RESTRICTED_READAHEAD 0x00000200U /* Readahead restricted to 2-120? */ #define FMT_BAS 0x000000400U /* Supports bootloader areas? */ +#define FMT_CONFIG_PROFILE 0x000000800U /* Supports configuration profiles? */ /* Mirror conversion type flags */ #define MIRROR_BY_SEG 0x00000001U /* segment-by-segment mirror */ diff --git a/tools/vgcreate.c b/tools/vgcreate.c index 9be9416d2..45f4c04fb 100644 --- a/tools/vgcreate.c +++ b/tools/vgcreate.c @@ -62,6 +62,9 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv) return ECMD_FAILED; } + if (vg->fid->fmt->features & FMT_CONFIG_PROFILE) + vg->profile = vg->cmd->profile_params->global_profile; + if (!vg_set_extent_size(vg, vp_new.extent_size) || !vg_set_max_lv(vg, vp_new.max_lv) || !vg_set_max_pv(vg, vp_new.max_pv) ||