X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=daemon%2Flvm.c;h=3920e95b848b9c5e1c4b1bf4d52b4c6fa552906e;hb=52390cde840925d4f7e194fcafa7963ad7a2ec04;hp=ddc125c93742e90fdf40ee5ddfe6b52de893bdec;hpb=84fc760439e82e6b3616abd0d1f9bd7d7eb01ec0;p=libguestfs.git diff --git a/daemon/lvm.c b/daemon/lvm.c index ddc125c..3920e95 100644 --- a/daemon/lvm.c +++ b/daemon/lvm.c @@ -22,9 +22,9 @@ #include #include #include -#include #include "daemon.h" +#include "c-ctype.h" #include "actions.h" /* LVM actions. Keep an eye on liblvm, although at the time @@ -49,12 +49,12 @@ convert_lvm_output (char *out, const char *prefix) 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; - while (*p && isspace (p[len])) + while (*p && c_isspace (p[len])) p[len--] = '\0'; if (!*p) { /* Empty line? Skip it. */ @@ -192,16 +192,12 @@ do_pvcreate (const char *device) } int -do_vgcreate (const char *volgroup, char **physvols) +do_vgcreate (const char *volgroup, char *const *physvols) { 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) { @@ -214,7 +210,7 @@ do_vgcreate (const char *volgroup, char **physvols) 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); @@ -424,7 +420,7 @@ do_pvresize (const char *device) } int -do_vg_activate (int activate, char **volgroups) +do_vg_activate (int activate, char *const *volgroups) { char *err; int r, i, argc; @@ -444,7 +440,7 @@ do_vg_activate (int activate, char **volgroups) 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);