diff options
author | Richard Jones <rjones@redhat.com> | 2009-06-10 11:11:14 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-06-10 11:11:14 +0100 |
commit | 2df2f2854ed2d1f9857ef3c5aaca29810cf3c506 (patch) | |
tree | 9da6966c5e069fe880640d266a06da36bda589ec /daemon/lvm.c | |
parent | 4aea83962337ac5e5847398e2128a9dbb8779247 (diff) | |
download | libguestfs-2df2f2854ed2d1f9857ef3c5aaca29810cf3c506.tar.gz libguestfs-2df2f2854ed2d1f9857ef3c5aaca29810cf3c506.tar.xz libguestfs-2df2f2854ed2d1f9857ef3c5aaca29810cf3c506.zip |
Add IS_DEVICE checks for all calls which take a device parameter.
Diffstat (limited to 'daemon/lvm.c')
-rw-r--r-- | daemon/lvm.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/daemon/lvm.c b/daemon/lvm.c index 40377f10..c30d4e7b 100644 --- a/daemon/lvm.c +++ b/daemon/lvm.c @@ -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) { |