diff options
author | David Teigland <teigland@redhat.com> | 2014-09-03 11:47:33 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2014-09-04 15:24:26 -0500 |
commit | 3192c68924aba656e1d5924250be4c3a9470eae5 (patch) | |
tree | c56aa6e4cdc09270735a9e75dae4ebf662e2dcb5 | |
parent | afabafaa7c8b41971550caf36e429488554d6fcc (diff) | |
download | lvm2-dev-dct-valid-cache3.tar.gz |
vgchange: disallow clustered vg with thin or cache typedev-dct-valid-cache3
-rw-r--r-- | tools/vgchange.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/vgchange.c b/tools/vgchange.c index 88dc18079..4c115ad53 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c @@ -304,6 +304,26 @@ static int _vgchange_clustered(struct cmd_context *cmd, struct volume_group *vg) { int clustered = !strcmp(arg_str_value(cmd, clustered_ARG, "n"), "y"); + struct lv_list *lvl; + struct logical_volume *lv; + + if (clustered) { + dm_list_iterate_items(lvl, &vg->lvs) { + lv = lvl->lv; + + if (lv_is_cache_type(lv)) { + log_error("Clustered VG is not supported with cache type LV %s", + display_lvname(lv)); + return 0; + } + + if (lv_is_thin_type(lv)) { + log_error("Clustered VG is not supported with thin type LV %s", + display_lvname(lv)); + return 0; + } + } + } if (clustered && (vg_is_clustered(vg))) { log_error("Volume group \"%s\" is already clustered", |