git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Check for ocaml-xml-light-devel (xml-light.cmxa)
[libguestfs.git]
/
daemon
/
lvm.c
diff --git
a/daemon/lvm.c
b/daemon/lvm.c
index
bee62d4
..
3920e95
100644
(file)
--- a/
daemon/lvm.c
+++ b/
daemon/lvm.c
@@
-22,9
+22,9
@@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <ctype.h>
#include "daemon.h"
#include "daemon.h"
+#include "c-ctype.h"
#include "actions.h"
/* LVM actions. Keep an eye on liblvm, although at the time
#include "actions.h"
/* LVM actions. Keep an eye on liblvm, although at the time
@@
-32,7
+32,7
@@
*/
static char **
*/
static char **
-convert_lvm_output (char *out, char *prefix)
+convert_lvm_output (char *out, c
onst c
har *prefix)
{
char *p, *pend;
char **r = NULL;
{
char *p, *pend;
char **r = NULL;
@@
-49,12
+49,12
@@
convert_lvm_output (char *out, char *prefix)
pend++;
}
pend++;
}
- while (*p &&
isspace (*p))
/* Skip any leading whitespace. */
+ while (*p &&
c_isspace (*p))
/* Skip any leading whitespace. */
p++;
/* Sigh, skip trailing whitespace too. "pvs", I'm looking at you. */
len = strlen (p)-1;
p++;
/* Sigh, skip trailing whitespace too. "pvs", I'm looking at you. */
len = strlen (p)-1;
- while (*p && isspace (p[len]))
+ while (*p &&
c_
isspace (p[len]))
p[len--] = '\0';
if (!*p) { /* Empty line? Skip it. */
p[len--] = '\0';
if (!*p) { /* Empty line? Skip it. */
@@
-171,7
+171,7
@@
do_lvs_full (void)
}
int
}
int
-do_pvcreate (char *device)
+do_pvcreate (c
onst c
har *device)
{
char *err;
int r;
{
char *err;
int r;
@@
-192,16
+192,12
@@
do_pvcreate (char *device)
}
int
}
int
-do_vgcreate (c
har *volgroup, char *
*physvols)
+do_vgcreate (c
onst char *volgroup, char *const
*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)
- RESOLVE_DEVICE (physvols[i], return -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) {
@@
-214,7
+210,7
@@
do_vgcreate (char *volgroup, char **physvols)
for (i = 3; i <= argc; ++i)
argv[i] = physvols[i-3];
for (i = 3; i <= argc; ++i)
argv[i] = physvols[i-3];
- r = commandv (NULL, &err, argv);
+ r = commandv (NULL, &err,
(const char * const*)
argv);
if (r == -1) {
reply_with_error ("%s", err);
free (err);
if (r == -1) {
reply_with_error ("%s", err);
free (err);
@@
-229,7
+225,7
@@
do_vgcreate (char *volgroup, char **physvols)
}
int
}
int
-do_lvcreate (c
har *logvol,
char *volgroup, int mbytes)
+do_lvcreate (c
onst char *logvol, const
char *volgroup, int mbytes)
{
char *err;
int r;
{
char *err;
int r;
@@
-254,14
+250,12
@@
do_lvcreate (char *logvol, char *volgroup, int mbytes)
}
int
}
int
-do_lvresize (char *logvol, int mbytes)
+do_lvresize (c
onst c
har *logvol, int mbytes)
{
char *err;
int r;
char size[64];
{
char *err;
int r;
char size[64];
- RESOLVE_DEVICE (logvol, return -1);
-
snprintf (size, sizeof size, "%d", mbytes);
r = command (NULL, &err,
snprintf (size, sizeof size, "%d", mbytes);
r = command (NULL, &err,
@@
-345,7
+339,7
@@
do_lvm_remove_all (void)
}
int
}
int
-do_lvremove (char *device)
+do_lvremove (c
onst c
har *device)
{
char *err;
int r;
{
char *err;
int r;
@@
-366,7
+360,7
@@
do_lvremove (char *device)
}
int
}
int
-do_vgremove (char *device)
+do_vgremove (c
onst c
har *device)
{
char *err;
int r;
{
char *err;
int r;
@@
-387,7
+381,7
@@
do_vgremove (char *device)
}
int
}
int
-do_pvremove (char *device)
+do_pvremove (c
onst c
har *device)
{
char *err;
int r;
{
char *err;
int r;
@@
-408,7
+402,7
@@
do_pvremove (char *device)
}
int
}
int
-do_pvresize (char *device)
+do_pvresize (c
onst c
har *device)
{
char *err;
int r;
{
char *err;
int r;
@@
-426,7
+420,7
@@
do_pvresize (char *device)
}
int
}
int
-do_vg_activate (int activate, char **volgroups)
+do_vg_activate (int activate, char *
const
*volgroups)
{
char *err;
int r, i, argc;
{
char *err;
int r, i, argc;
@@
-446,7
+440,7
@@
do_vg_activate (int activate, char **volgroups)
for (i = 4; i <= argc; ++i)
argv[i] = volgroups[i-4];
for (i = 4; i <= argc; ++i)
argv[i] = volgroups[i-4];
- r = commandv (NULL, &err, argv);
+ r = commandv (NULL, &err,
(const char * const*)
argv);
if (r == -1) {
reply_with_error ("vgchange: %s", err);
free (err);
if (r == -1) {
reply_with_error ("vgchange: %s", err);
free (err);