summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-10 23:07:21 +0200
committerJim Meyering <meyering@redhat.com>2009-08-13 14:45:34 +0200
commit0c07f0d23698798475e0d09491812aca52440328 (patch)
treef491f09a5681ddb920b5dee5b2fe7f084f355412 /daemon
parent8601bbda56cdb2b8491b6e2054596ec9599c38f1 (diff)
downloadlibguestfs-0c07f0d23698798475e0d09491812aca52440328.tar.gz
libguestfs-0c07f0d23698798475e0d09491812aca52440328.tar.xz
libguestfs-0c07f0d23698798475e0d09491812aca52440328.zip
* src/generator.ml: Change all `String "device"' to `Device "device"'.
Then update each affected function, removing each uses of RESOLVE_DEVICE, now that it's generated in caller from stub.c. * daemon/blockdev.c (call_blockdev): Remove use of RESOLVE_DEVICE. * daemon/devsparts.c (do_mkfs): Likewise. * daemon/ext2.c (do_e2fsck_f, do_get_e2label, do_get_e2uuid): Likewise. (do_resize2fs, do_set_e2label, do_set_e2uuid, do_tune2fs_l): Likewise. * daemon/fsck.c (do_fsck): Likewise. * daemon/grub.c (do_grub_install): Likewise. * daemon/lvm.c (do_lvremove, do_pvcreate, do_pvremove): Likewise. (do_pvresize): Likewise. * daemon/mount.c (do_mount_vfs): Likewise. * daemon/ntfs.c (do_ntfs_3g_probe): Likewise. * daemon/scrub.c (do_scrub_device): Likewise. * daemon/sfdisk.c (sfdisk, sfdisk_flag): Likewise. * daemon/swap.c (do_mkswap, do_mkswap_L, do_mkswap_U): Likewise. (do_swapoff_device, do_swapon_device): Likewise. * daemon/zero.c (do_zero): Likewise. * daemon/zerofree.c (do_zerofree): Likewise.
Diffstat (limited to 'daemon')
-rw-r--r--daemon/blockdev.c2
-rw-r--r--daemon/devsparts.c2
-rw-r--r--daemon/ext2.c14
-rw-r--r--daemon/fsck.c2
-rw-r--r--daemon/grub.c1
-rw-r--r--daemon/lvm.c8
-rw-r--r--daemon/mount.c2
-rw-r--r--daemon/ntfs.c2
-rw-r--r--daemon/scrub.c2
-rw-r--r--daemon/sfdisk.c4
-rw-r--r--daemon/swap.c10
-rw-r--r--daemon/zero.c2
-rw-r--r--daemon/zerofree.c2
13 files changed, 0 insertions, 53 deletions
diff --git a/daemon/blockdev.c b/daemon/blockdev.c
index a5f76914..46ee9948 100644
--- a/daemon/blockdev.c
+++ b/daemon/blockdev.c
@@ -46,8 +46,6 @@ call_blockdev (char *device, char *switc, int extraarg, int prints)
};
char buf[64];
- RESOLVE_DEVICE (device, return -1);
-
if (extraarg > 0) {
snprintf (buf, sizeof buf, "%d", extraarg);
argv[2] = buf;
diff --git a/daemon/devsparts.c b/daemon/devsparts.c
index c3b9756c..04585ed7 100644
--- a/daemon/devsparts.c
+++ b/daemon/devsparts.c
@@ -193,8 +193,6 @@ do_mkfs (char *fstype, char *device)
char *err;
int r;
- RESOLVE_DEVICE (device, return -1);
-
r = command (NULL, &err, "/sbin/mkfs", "-t", fstype, device, NULL);
if (r == -1) {
reply_with_error ("mkfs: %s", err);
diff --git a/daemon/ext2.c b/daemon/ext2.c
index d2304bd0..04869daf 100644
--- a/daemon/ext2.c
+++ b/daemon/ext2.c
@@ -36,8 +36,6 @@ do_tune2fs_l (char *device)
char **ret = NULL;
int size = 0, alloc = 0;
- RESOLVE_DEVICE (device, return NULL);
-
r = command (&out, &err, "/sbin/tune2fs", "-l", device, NULL);
if (r == -1) {
reply_with_error ("tune2fs: %s", err);
@@ -122,8 +120,6 @@ do_set_e2label (char *device, char *label)
int r;
char *err;
- RESOLVE_DEVICE (device, return -1);
-
r = command (NULL, &err, "/sbin/e2label", device, label, NULL);
if (r == -1) {
reply_with_error ("e2label: %s", err);
@@ -141,8 +137,6 @@ do_get_e2label (char *device)
int r, len;
char *out, *err;
- RESOLVE_DEVICE (device, return NULL);
-
r = command (&out, &err, "/sbin/e2label", device, NULL);
if (r == -1) {
reply_with_error ("e2label: %s", err);
@@ -167,8 +161,6 @@ do_set_e2uuid (char *device, char *uuid)
int r;
char *err;
- RESOLVE_DEVICE (device, return -1);
-
r = command (NULL, &err, "/sbin/tune2fs", "-U", uuid, device, NULL);
if (r == -1) {
reply_with_error ("tune2fs -U: %s", err);
@@ -186,8 +178,6 @@ do_get_e2uuid (char *device)
int r;
char *out, *err, *p, *q;
- RESOLVE_DEVICE (device, return NULL);
-
/* It's not so straightforward to get the volume UUID. We have
* to use tune2fs -l and then look for a particular string in
* the output.
@@ -249,8 +239,6 @@ do_resize2fs (char *device)
char *err;
int r;
- RESOLVE_DEVICE (device, return -1);
-
r = command (NULL, &err, "/sbin/resize2fs", device, NULL);
if (r == -1) {
reply_with_error ("resize2fs: %s", err);
@@ -268,8 +256,6 @@ do_e2fsck_f (char *device)
char *err;
int r;
- RESOLVE_DEVICE (device, return -1);
-
r = command (NULL, &err, "/sbin/e2fsck", "-p", "-f", device, NULL);
if (r == -1) {
reply_with_error ("e2fsck: %s", err);
diff --git a/daemon/fsck.c b/daemon/fsck.c
index 907c117e..825f97e0 100644
--- a/daemon/fsck.c
+++ b/daemon/fsck.c
@@ -32,8 +32,6 @@ do_fsck (char *fstype, char *device)
char *err;
int r;
- RESOLVE_DEVICE (device, return -1);
-
r = commandr (NULL, &err, "/sbin/fsck", "-a", "-t", fstype, device, NULL);
if (r == -1) {
reply_with_error ("fsck: %s: %s", device, err);
diff --git a/daemon/grub.c b/daemon/grub.c
index 8fcd911d..0a49c45d 100644
--- a/daemon/grub.c
+++ b/daemon/grub.c
@@ -34,7 +34,6 @@ do_grub_install (char *root, char *device)
NEED_ROOT (-1);
ABS_PATH (root, return -1);
- RESOLVE_DEVICE (device, return -1);
if (asprintf_nowarn (&buf, "--root-directory=%R", root) == -1) {
reply_with_perror ("asprintf");
diff --git a/daemon/lvm.c b/daemon/lvm.c
index 8f575c49..bee62d46 100644
--- a/daemon/lvm.c
+++ b/daemon/lvm.c
@@ -176,8 +176,6 @@ do_pvcreate (char *device)
char *err;
int r;
- RESOLVE_DEVICE (device, return -1);
-
r = command (NULL, &err,
"/sbin/lvm", "pvcreate", device, NULL);
if (r == -1) {
@@ -352,8 +350,6 @@ do_lvremove (char *device)
char *err;
int r;
- RESOLVE_DEVICE (device, return -1);
-
r = command (NULL, &err,
"/sbin/lvm", "lvremove", "-f", device, NULL);
if (r == -1) {
@@ -396,8 +392,6 @@ do_pvremove (char *device)
char *err;
int r;
- RESOLVE_DEVICE (device, return -1);
-
r = command (NULL, &err,
"/sbin/lvm", "pvremove", "-ff", device, NULL);
if (r == -1) {
@@ -419,8 +413,6 @@ do_pvresize (char *device)
char *err;
int r;
- RESOLVE_DEVICE (device, return -1);
-
r = command (NULL, &err,
"/sbin/lvm", "pvresize", device, NULL);
if (r == -1) {
diff --git a/daemon/mount.c b/daemon/mount.c
index 8cf68749..14e683af 100644
--- a/daemon/mount.c
+++ b/daemon/mount.c
@@ -48,8 +48,6 @@ do_mount_vfs (char *options, char *vfstype,
char *mp;
char *error;
- RESOLVE_DEVICE (device, return -1);
-
is_root = strcmp (mountpoint, "/") == 0;
if (!root_mounted && !is_root) {
diff --git a/daemon/ntfs.c b/daemon/ntfs.c
index 8cb4f6fe..1d73f2e1 100644
--- a/daemon/ntfs.c
+++ b/daemon/ntfs.c
@@ -33,8 +33,6 @@ do_ntfs_3g_probe (int rw, char *device)
int r;
const char *rw_flag;
- RESOLVE_DEVICE (device, return -1);
-
rw_flag = rw ? "-w" : "-r";
r = commandr (NULL, &err, "ntfs-3g.probe", rw_flag, device, NULL);
diff --git a/daemon/scrub.c b/daemon/scrub.c
index f1601f9f..2beaea31 100644
--- a/daemon/scrub.c
+++ b/daemon/scrub.c
@@ -33,8 +33,6 @@ do_scrub_device (char *device)
char *err;
int r;
- RESOLVE_DEVICE (device, return -1);
-
r = command (NULL, &err, "scrub", device, NULL);
if (r == -1) {
reply_with_error ("scrub_device: %s: %s", device, err);
diff --git a/daemon/sfdisk.c b/daemon/sfdisk.c
index a504141d..e16e8c91 100644
--- a/daemon/sfdisk.c
+++ b/daemon/sfdisk.c
@@ -38,8 +38,6 @@ sfdisk (char *device, int n, int cyls, int heads, int sectors,
char buf[256];
int i;
- RESOLVE_DEVICE (device, return -1);
-
strcpy (buf, "/sbin/sfdisk");
if (n > 0)
@@ -111,8 +109,6 @@ sfdisk_flag (char *device, const char *flag)
char *out, *err;
int r;
- RESOLVE_DEVICE (device, return NULL);
-
r = command (&out, &err, "/sbin/sfdisk", flag, device, NULL);
if (r == -1) {
reply_with_error ("sfdisk: %s: %s", device, err);
diff --git a/daemon/swap.c b/daemon/swap.c
index bb1706fa..f7270f8f 100644
--- a/daemon/swap.c
+++ b/daemon/swap.c
@@ -52,24 +52,18 @@ mkswap (char *device, const char *flag, const char *value)
int
do_mkswap (char *device)
{
- RESOLVE_DEVICE (device, return -1);
-
return mkswap (device, NULL, NULL);
}
int
do_mkswap_L (char *label, char *device)
{
- RESOLVE_DEVICE (device, return -1);
-
return mkswap (device, "-L", label);
}
int
do_mkswap_U (char *uuid, char *device)
{
- RESOLVE_DEVICE (device, return -1);
-
return mkswap (device, "-U", uuid);
}
@@ -118,16 +112,12 @@ swaponoff (const char *cmd, const char *flag, const char *value)
int
do_swapon_device (char *device)
{
- RESOLVE_DEVICE (device, return -1);
-
return swaponoff ("/sbin/swapon", NULL, device);
}
int
do_swapoff_device (char *device)
{
- RESOLVE_DEVICE (device, return -1);
-
return swaponoff ("/sbin/swapoff", NULL, device);
}
diff --git a/daemon/zero.c b/daemon/zero.c
index ba87e68b..864e9a66 100644
--- a/daemon/zero.c
+++ b/daemon/zero.c
@@ -33,8 +33,6 @@ do_zero (char *device)
int fd, i;
char buf[4096];
- RESOLVE_DEVICE (device, return -1);
-
fd = open (device, O_WRONLY);
if (fd == -1) {
reply_with_perror ("%s", device);
diff --git a/daemon/zerofree.c b/daemon/zerofree.c
index 27ef692a..457f8db0 100644
--- a/daemon/zerofree.c
+++ b/daemon/zerofree.c
@@ -33,8 +33,6 @@ do_zerofree (char *device)
char *err;
int r;
- RESOLVE_DEVICE (device, return -1);
-
r = command (NULL, &err, "/usr/sbin/zerofree", device, NULL);
if (r == -1) {
reply_with_error ("zerofree: %s: %s", device, err);