diff options
author | Dave Wysochanski <dwysocha@redhat.com> | 2008-01-16 19:54:39 +0000 |
---|---|---|
committer | Dave Wysochanski <dwysocha@redhat.com> | 2008-01-16 19:54:39 +0000 |
commit | d865615e9a058c9d33a7167974f391cb62ec0c17 (patch) | |
tree | 9fee293cd4e438f5b7153436aeba72ac2d6c223d /tools/vgsplit.c | |
parent | ba4d6ad8ea143042e13b8f22c8e60eb38c9d4da1 (diff) | |
download | lvm2-d865615e9a058c9d33a7167974f391cb62ec0c17.tar.gz lvm2-d865615e9a058c9d33a7167974f391cb62ec0c17.tar.xz lvm2-d865615e9a058c9d33a7167974f391cb62ec0c17.zip |
Create vgs_are_compatible() fn to check whether vgs are compatible for merging.
Add new vgmerge and vgsplit tests to check rejection of incompatible vgs.
Cleanup comments.
Bugzilla: bz251992
---
lib/metadata/metadata-exported.h | 3 +
lib/metadata/metadata.c | 89 +++++++++++++++++++++++++++++++++-
test/t-vgmerge-usage.sh | 101 +++++++++++++++++++++++++++++++++++++++
test/t-vgsplit-operation.sh | 20 +++++++
tools/vgmerge.c | 69 --------------------------
tools/vgsplit.c | 5 -
6 files changed, 215 insertions(+), 72 deletions(-)
Diffstat (limited to 'tools/vgsplit.c')
-rw-r--r-- | tools/vgsplit.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/vgsplit.c b/tools/vgsplit.c index ea35a8e5..f78eaf3b 100644 --- a/tools/vgsplit.c +++ b/tools/vgsplit.c @@ -254,7 +254,8 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv) LCK_VG_WRITE | LCK_NONBLOCK, 0, 0))) { log_warn("Volume group \"%s\" already exists", vg_name_to); - /* FIXME: check compatibility with existing vg, esp attribs */ + if (!vgs_are_compatible(cmd, vg_from,vg_to)) + goto error; } else { /* Set metadata format of original VG */ @@ -274,8 +275,6 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv) if (validate_vg_create_params(cmd, &vp_new)) return EINVALID_CMD_LINE; - /* Create new VG structure */ - /* FIXME: allow user input same params as to vgcreate tool */ if (!(vg_to = vg_create(cmd, vg_name_to, vp_new.extent_size, vp_new.max_pv, vp_new.max_lv, vp_new.alloc, 0, NULL))) |