summaryrefslogtreecommitdiff
path: root/tools/vgextend.c
diff options
context:
space:
mode:
authorDave Wysochanski <dwysocha@redhat.com>2009-10-05 20:04:08 +0000
committerDave Wysochanski <dwysocha@redhat.com>2009-10-05 20:04:08 +0000
commit2e201936e466e8d93e7122645b37753629762caa (patch)
treefc6b201641033f7914f185cc2111fb778c56ea61 /tools/vgextend.c
parentf900ba63fa236dc2e7949e6005156fdab5f551cd (diff)
downloadlvm2-2e201936e466e8d93e7122645b37753629762caa.tar.gz
Add implicit pvcreate support to vgcreate and vgextend.
Adds implicit pvcreate support when calling vgcreate or vgextend with device paths that are not yet PVs. This changes the behavior of vgcreate and vgextend from failing with an error message to implicitly pvcreating.
Diffstat (limited to 'tools/vgextend.c')
-rw-r--r--tools/vgextend.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/vgextend.c b/tools/vgextend.c
index c97b3bb35..76554e75e 100644
--- a/tools/vgextend.c
+++ b/tools/vgextend.c
@@ -20,6 +20,7 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv)
char *vg_name;
struct volume_group *vg = NULL;
int r = ECMD_FAILED;
+ struct pvcreate_params pp;
if (!argc) {
log_error("Please enter volume group name and "
@@ -31,8 +32,8 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv)
argc--;
argv++;
- if (argc == 0) {
- log_error("Please enter physical volume(s)");
+ fill_default_pvcreate_params(&pp);
+ if (!pvcreate_validate_params(cmd, argc, argv, &pp)) {
return EINVALID_CMD_LINE;
}
@@ -54,7 +55,7 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv)
goto_bad;
/* extend vg */
- if (!vg_extend(vg, argc, argv, NULL))
+ if (!vg_extend(vg, argc, argv, &pp))
goto_bad;
/* ret > 0 */