git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Supermin: choose newest available kernel.
[libguestfs.git]
/
daemon
/
lvm.c
diff --git
a/daemon/lvm.c
b/daemon/lvm.c
index
40377f1
..
143c5a8
100644
(file)
--- a/
daemon/lvm.c
+++ b/
daemon/lvm.c
@@
-171,11
+171,13
@@
do_lvs_full (void)
}
int
}
int
-do_pvcreate (c
onst c
har *device)
+do_pvcreate (char *device)
{
char *err;
int r;
{
char *err;
int r;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err,
"/sbin/lvm", "pvcreate", device, NULL);
if (r == -1) {
r = command (NULL, &err,
"/sbin/lvm", "pvcreate", device, NULL);
if (r == -1) {
@@
-189,12
+191,16
@@
do_pvcreate (const char *device)
}
int
}
int
-do_vgcreate (c
onst char *volgroup, char * const* const
physvols)
+do_vgcreate (c
har *volgroup, char **
physvols)
{
char *err;
int r, argc, i;
const char **argv;
{
char *err;
int r, argc, i;
const char **argv;
+ /* 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));
if (argv == NULL) {
argc = count_strings (physvols) + 3;
argv = malloc (sizeof (char *) * (argc + 1));
if (argv == NULL) {
@@
-219,7
+225,7
@@
do_vgcreate (const char *volgroup, char * const* const physvols)
}
int
}
int
-do_lvcreate (c
onst char *logvol, const
char *volgroup, int mbytes)
+do_lvcreate (c
har *logvol,
char *volgroup, int mbytes)
{
char *err;
int r;
{
char *err;
int r;
@@
-241,7
+247,7
@@
do_lvcreate (const char *logvol, const char *volgroup, int mbytes)
}
int
}
int
-do_lvresize (c
onst c
har *logvol, int mbytes)
+do_lvresize (char *logvol, int mbytes)
{
char *err;
int r;
{
char *err;
int r;
@@
-330,11
+336,13
@@
do_lvm_remove_all (void)
}
int
}
int
-do_lvremove (c
onst c
har *device)
+do_lvremove (char *device)
{
char *err;
int r;
{
char *err;
int r;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err,
"/sbin/lvm", "lvremove", "-f", device, NULL);
if (r == -1) {
r = command (NULL, &err,
"/sbin/lvm", "lvremove", "-f", device, NULL);
if (r == -1) {
@@
-348,7
+356,7
@@
do_lvremove (const char *device)
}
int
}
int
-do_vgremove (c
onst c
har *device)
+do_vgremove (char *device)
{
char *err;
int r;
{
char *err;
int r;
@@
-366,11
+374,13
@@
do_vgremove (const char *device)
}
int
}
int
-do_pvremove (c
onst c
har *device)
+do_pvremove (char *device)
{
char *err;
int r;
{
char *err;
int r;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err,
"/sbin/lvm", "pvremove", "-ff", device, NULL);
if (r == -1) {
r = command (NULL, &err,
"/sbin/lvm", "pvremove", "-ff", device, NULL);
if (r == -1) {
@@
-384,11
+394,13
@@
do_pvremove (const char *device)
}
int
}
int
-do_pvresize (c
onst c
har *device)
+do_pvresize (char *device)
{
char *err;
int r;
{
char *err;
int r;
+ IS_DEVICE (device, -1);
+
r = command (NULL, &err,
"/sbin/lvm", "pvresize", device, NULL);
if (r == -1) {
r = command (NULL, &err,
"/sbin/lvm", "pvresize", device, NULL);
if (r == -1) {
@@
-402,7
+414,7
@@
do_pvresize (const char *device)
}
int
}
int
-do_vg_activate (int activate, char *
const* const
volgroups)
+do_vg_activate (int activate, char *
*
volgroups)
{
char *err;
int r, i, argc;
{
char *err;
int r, i, argc;