git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
s/NEED_ROOT_OR_IS_DEVICE/REQUIRE_ROOT_OR_RESOLVE_DEVICE/
[libguestfs.git]
/
daemon
/
lvm.c
diff --git
a/daemon/lvm.c
b/daemon/lvm.c
index
0fba447
..
8f575c4
100644
(file)
--- a/
daemon/lvm.c
+++ b/
daemon/lvm.c
@@
-1,5
+1,5
@@
/* libguestfs - the guestfsd daemon
/* libguestfs - the guestfsd daemon
- * Copyright (C) 2009 Red Hat Inc.
+ * Copyright (C) 2009 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-93,7
+93,7
@@
do_pvs (void)
int r;
r = command (&out, &err,
int r;
r = command (&out, &err,
- "/sbin/lvm", "pvs", "-o", "pv_name", "--noheadings", NULL);
+
"/sbin/lvm", "pvs", "-o", "pv_name", "--noheadings", NULL);
if (r == -1) {
reply_with_error ("%s", err);
free (out);
if (r == -1) {
reply_with_error ("%s", err);
free (out);
@@
-113,7
+113,7
@@
do_vgs (void)
int r;
r = command (&out, &err,
int r;
r = command (&out, &err,
- "/sbin/lvm", "vgs", "-o", "vg_name", "--noheadings", NULL);
+
"/sbin/lvm", "vgs", "-o", "vg_name", "--noheadings", NULL);
if (r == -1) {
reply_with_error ("%s", err);
free (out);
if (r == -1) {
reply_with_error ("%s", err);
free (out);
@@
-133,9
+133,9
@@
do_lvs (void)
int r;
r = command (&out, &err,
int r;
r = command (&out, &err,
- "/sbin/lvm", "lvs",
- "-o", "vg_name,lv_name", "--noheadings",
- "--separator", "/", NULL);
+
"/sbin/lvm", "lvs",
+
"-o", "vg_name,lv_name", "--noheadings",
+
"--separator", "/", NULL);
if (r == -1) {
reply_with_error ("%s", err);
free (out);
if (r == -1) {
reply_with_error ("%s", err);
free (out);
@@
-152,19
+152,19
@@
do_lvs (void)
* the code. That code is in stubs.c, and it is generated as usual
* by generator.ml.
*/
* the code. That code is in stubs.c, and it is generated as usual
* by generator.ml.
*/
-guestfs_
lvm_int
_pv_list *
+guestfs_
int_lvm
_pv_list *
do_pvs_full (void)
{
return parse_command_line_pvs ();
}
do_pvs_full (void)
{
return parse_command_line_pvs ();
}
-guestfs_
lvm_int
_vg_list *
+guestfs_
int_lvm
_vg_list *
do_vgs_full (void)
{
return parse_command_line_vgs ();
}
do_vgs_full (void)
{
return parse_command_line_vgs ();
}
-guestfs_
lvm_int
_lv_list *
+guestfs_
int_lvm
_lv_list *
do_lvs_full (void)
{
return parse_command_line_lvs ();
do_lvs_full (void)
{
return parse_command_line_lvs ();
@@
-176,10
+176,10
@@
do_pvcreate (char *device)
char *err;
int r;
char *err;
int r;
-
IS_DEVICE (device,
-1);
+
RESOLVE_DEVICE (device, return
-1);
r = command (NULL, &err,
r = command (NULL, &err,
- "/sbin/lvm", "pvcreate", device, NULL);
+
"/sbin/lvm", "pvcreate", device, NULL);
if (r == -1) {
reply_with_error ("%s", err);
free (err);
if (r == -1) {
reply_with_error ("%s", err);
free (err);
@@
-202,7
+202,7
@@
do_vgcreate (char *volgroup, char **physvols)
/* Check they are devices and also do device name translation. */
for (i = 0; physvols[i] != NULL; ++i)
/* Check they are devices and also do device name translation. */
for (i = 0; physvols[i] != NULL; ++i)
-
IS_DEVICE (physvols[i],
-1);
+
RESOLVE_DEVICE (physvols[i], return
-1);
argc = count_strings (physvols) + 3;
argv = malloc (sizeof (char *) * (argc + 1));
argc = count_strings (physvols) + 3;
argv = malloc (sizeof (char *) * (argc + 1));
@@
-240,8
+240,8
@@
do_lvcreate (char *logvol, char *volgroup, int mbytes)
snprintf (size, sizeof size, "%d", mbytes);
r = command (NULL, &err,
snprintf (size, sizeof size, "%d", mbytes);
r = command (NULL, &err,
- "/sbin/lvm", "lvcreate",
- "-L", size, "-n", logvol, volgroup, NULL);
+
"/sbin/lvm", "lvcreate",
+
"-L", size, "-n", logvol, volgroup, NULL);
if (r == -1) {
reply_with_error ("%s", err);
free (err);
if (r == -1) {
reply_with_error ("%s", err);
free (err);
@@
-262,13
+262,13
@@
do_lvresize (char *logvol, int mbytes)
int r;
char size[64];
int r;
char size[64];
-
IS_DEVICE (logvol,
-1);
+
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,
- "/sbin/lvm", "lvresize",
- "-L", size, logvol, NULL);
+
"/sbin/lvm", "lvresize",
+
"-L", size, logvol, NULL);
if (r == -1) {
reply_with_error ("lvresize: %s", err);
free (err);
if (r == -1) {
reply_with_error ("lvresize: %s", err);
free (err);
@@
-352,10
+352,10
@@
do_lvremove (char *device)
char *err;
int r;
char *err;
int r;
-
IS_DEVICE (device,
-1);
+
RESOLVE_DEVICE (device, return
-1);
r = command (NULL, &err,
r = command (NULL, &err,
- "/sbin/lvm", "lvremove", "-f", device, NULL);
+
"/sbin/lvm", "lvremove", "-f", device, NULL);
if (r == -1) {
reply_with_error ("%s", err);
free (err);
if (r == -1) {
reply_with_error ("%s", err);
free (err);
@@
-376,7
+376,7
@@
do_vgremove (char *device)
int r;
r = command (NULL, &err,
int r;
r = command (NULL, &err,
- "/sbin/lvm", "vgremove", "-f", device, NULL);
+
"/sbin/lvm", "vgremove", "-f", device, NULL);
if (r == -1) {
reply_with_error ("%s", err);
free (err);
if (r == -1) {
reply_with_error ("%s", err);
free (err);
@@
-396,10
+396,10
@@
do_pvremove (char *device)
char *err;
int r;
char *err;
int r;
-
IS_DEVICE (device,
-1);
+
RESOLVE_DEVICE (device, return
-1);
r = command (NULL, &err,
r = command (NULL, &err,
- "/sbin/lvm", "pvremove", "-ff", device, NULL);
+
"/sbin/lvm", "pvremove", "-ff", device, NULL);
if (r == -1) {
reply_with_error ("%s", err);
free (err);
if (r == -1) {
reply_with_error ("%s", err);
free (err);
@@
-419,10
+419,10
@@
do_pvresize (char *device)
char *err;
int r;
char *err;
int r;
-
IS_DEVICE (device,
-1);
+
RESOLVE_DEVICE (device, return
-1);
r = command (NULL, &err,
r = command (NULL, &err,
- "/sbin/lvm", "pvresize", device, NULL);
+
"/sbin/lvm", "pvresize", device, NULL);
if (r == -1) {
reply_with_error ("pvresize: %s: %s", device, err);
free (err);
if (r == -1) {
reply_with_error ("pvresize: %s: %s", device, err);
free (err);