In the daemon, change all const char * parameters to char *.
[libguestfs.git] / daemon / lvm.c
index c30d4e7..143c5a8 100644 (file)
@@ -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;