1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-25 01:34:38 +03:00

Refactor vgsplit for accepting existing vg as destination

This commit is contained in:
Dave Wysochanski 2008-01-11 20:17:18 +00:00
parent 0dc7e635d4
commit b2d68bd3d2

View File

@ -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;