diff options
author | Dave Wysochanski <dwysocha@redhat.com> | 2008-01-11 20:17:18 +0000 |
---|---|---|
committer | Dave Wysochanski <dwysocha@redhat.com> | 2008-01-11 20:17:18 +0000 |
commit | 6fcfb4048b0b2349ef60f5628733d31d6ed97922 (patch) | |
tree | c64b15d26d9eb5011268166ae6ff84432b338d2f /tools/vgsplit.c | |
parent | dc5f6f1b4f76690484d62efe83565a332152b9f4 (diff) | |
download | lvm2-6fcfb4048b0b2349ef60f5628733d31d6ed97922.tar.gz lvm2-6fcfb4048b0b2349ef60f5628733d31d6ed97922.tar.xz lvm2-6fcfb4048b0b2349ef60f5628733d31d6ed97922.zip |
Refactor vgsplit for accepting existing vg as destination
Diffstat (limited to 'tools/vgsplit.c')
-rw-r--r-- | tools/vgsplit.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/vgsplit.c b/tools/vgsplit.c index fdeed542..e2ab6042 100644 --- a/tools/vgsplit.c +++ b/tools/vgsplit.c @@ -239,6 +239,14 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv) CORRECT_INCONSISTENT | FAIL_INCONSISTENT))) return ECMD_FAILED; + if ((active = lvs_in_vg_activated(vg_from))) { + /* FIXME Remove this restriction */ + log_error("Logical volumes in \"%s\" must be inactive", + vg_name_from); + unlock_vg(cmd, vg_name_from); + return ECMD_FAILED; + } + log_verbose("Checking for new volume group \"%s\"", vg_name_to); if ((vg_to = vg_lock_and_read(cmd, vg_name_to, NULL, LCK_VG_WRITE | LCK_NONBLOCK, @@ -249,13 +257,6 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv) return ECMD_FAILED; } - if ((active = lvs_in_vg_activated(vg_from))) { - /* FIXME Remove this restriction */ - log_error("Logical volumes in \"%s\" must be inactive", - vg_name_from); - goto error; - } - /* Set metadata format of original VG */ /* FIXME: need some common logic */ cmd->fmt = vg_from->fid->fmt; |