X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Flvm.c;h=143c5a810447fe5e468ee655b6a1f5c76137ef30;hb=3ed322c7c8f1b7342af095ba6a8fb60a8e9a076b;hp=c30d4e7be8556e8b4a0e42da838c078a51bfd266;hpb=2df2f2854ed2d1f9857ef3c5aaca29810cf3c506;p=libguestfs.git diff --git a/daemon/lvm.c b/daemon/lvm.c index c30d4e7..143c5a8 100644 --- a/daemon/lvm.c +++ b/daemon/lvm.c @@ -171,7 +171,7 @@ do_lvs_full (void) } int -do_pvcreate (const char *device) +do_pvcreate (char *device) { char *err; int r; @@ -191,13 +191,15 @@ do_pvcreate (const char *device) } int -do_vgcreate (const char *volgroup, char * const* const physvols) +do_vgcreate (char *volgroup, char **physvols) { char *err; int r, argc, i; const char **argv; - Xphysvols; + /* Check they are devices and also do device name translation. */ + for (i = 0; physvols[i] != NULL; ++i) + IS_DEVICE (physvols[i], -1); argc = count_strings (physvols) + 3; argv = malloc (sizeof (char *) * (argc + 1)); @@ -223,7 +225,7 @@ do_vgcreate (const char *volgroup, char * const* const physvols) } int -do_lvcreate (const char *logvol, const char *volgroup, int mbytes) +do_lvcreate (char *logvol, char *volgroup, int mbytes) { char *err; int r; @@ -245,7 +247,7 @@ do_lvcreate (const char *logvol, const char *volgroup, int mbytes) } int -do_lvresize (const char *logvol, int mbytes) +do_lvresize (char *logvol, int mbytes) { char *err; int r; @@ -334,7 +336,7 @@ do_lvm_remove_all (void) } int -do_lvremove (const char *device) +do_lvremove (char *device) { char *err; int r; @@ -354,13 +356,11 @@ do_lvremove (const char *device) } int -do_vgremove (const char *device) +do_vgremove (char *device) { char *err; int r; - IS_DEVICE (device, -1); - r = command (NULL, &err, "/sbin/lvm", "vgremove", "-f", device, NULL); if (r == -1) { @@ -374,7 +374,7 @@ do_vgremove (const char *device) } int -do_pvremove (const char *device) +do_pvremove (char *device) { char *err; int r; @@ -394,7 +394,7 @@ do_pvremove (const char *device) } int -do_pvresize (const char *device) +do_pvresize (char *device) { char *err; int r; @@ -414,7 +414,7 @@ do_pvresize (const char *device) } int -do_vg_activate (int activate, char * const* const volgroups) +do_vg_activate (int activate, char **volgroups) { char *err; int r, i, argc;