Add IS_DEVICE checks for all calls which take a device parameter.
[libguestfs.git] / daemon / lvm.c
index 40377f1..c30d4e7 100644 (file)
@@ -176,6 +176,8 @@ do_pvcreate (const char *device)
   char *err;
   int r;
 
+  IS_DEVICE (device, -1);
+
   r = command (NULL, &err,
               "/sbin/lvm", "pvcreate", device, NULL);
   if (r == -1) {
@@ -195,6 +197,8 @@ do_vgcreate (const char *volgroup, char * const* const physvols)
   int r, argc, i;
   const char **argv;
 
+  Xphysvols;
+
   argc = count_strings (physvols) + 3;
   argv = malloc (sizeof (char *) * (argc + 1));
   if (argv == NULL) {
@@ -335,6 +339,8 @@ do_lvremove (const char *device)
   char *err;
   int r;
 
+  IS_DEVICE (device, -1);
+
   r = command (NULL, &err,
               "/sbin/lvm", "lvremove", "-f", device, NULL);
   if (r == -1) {
@@ -353,6 +359,8 @@ do_vgremove (const char *device)
   char *err;
   int r;
 
+  IS_DEVICE (device, -1);
+
   r = command (NULL, &err,
               "/sbin/lvm", "vgremove", "-f", device, NULL);
   if (r == -1) {
@@ -371,6 +379,8 @@ do_pvremove (const char *device)
   char *err;
   int r;
 
+  IS_DEVICE (device, -1);
+
   r = command (NULL, &err,
               "/sbin/lvm", "pvremove", "-ff", device, NULL);
   if (r == -1) {
@@ -389,6 +399,8 @@ do_pvresize (const char *device)
   char *err;
   int r;
 
+  IS_DEVICE (device, -1);
+
   r = command (NULL, &err,
               "/sbin/lvm", "pvresize", device, NULL);
   if (r == -1) {