[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH libguestfs 11/23] * src/generator.ml: Change all `String "device"' to `Device "device"'.



From: Jim Meyering <meyering redhat com>

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.
---
 daemon/blockdev.c  |    2 -
 daemon/devsparts.c |    2 -
 daemon/ext2.c      |   14 --------
 daemon/fsck.c      |    2 -
 daemon/grub.c      |    1 -
 daemon/lvm.c       |    8 -----
 daemon/mount.c     |    2 -
 daemon/ntfs.c      |    2 -
 daemon/scrub.c     |    2 -
 daemon/sfdisk.c    |    4 --
 daemon/swap.c      |   10 ------
 daemon/zero.c      |    2 -
 daemon/zerofree.c  |    2 -
 src/generator.ml   |   86 ++++++++++++++++++++++++++--------------------------
 14 files changed, 43 insertions(+), 96 deletions(-)

diff --git a/daemon/blockdev.c b/daemon/blockdev.c
index a5f7691..46ee994 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 c3b9756..04585ed 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 d2304bd..04869da 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 907c117..825f97e 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 8fcd911..0a49c45 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 8f575c4..bee62d4 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 8cf6874..14e683a 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 8cb4f6f..1d73f2e 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 f1601f9..2beaea3 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 cf62f51..fe58d96 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 bb1706f..f7270f8 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 ba87e68..864e9a6 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 27ef692..457f8db 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);
diff --git a/src/generator.ml b/src/generator.ml
index 20fe5c1..0c9cf36 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -769,7 +769,7 @@ of features.  Distro backports makes this unreliable.");
  *)

 let daemon_functions = [
-  ("mount", (RErr, [String "device"; String "mountpoint"]), 1, [],
+  ("mount", (RErr, [Device "device"; String "mountpoint"]), 1, [],
    [InitEmpty, Always, TestOutput (
       [["sfdiskM"; "/dev/sda"; ","];
        ["mkfs"; "ext2"; "/dev/sda1"];
@@ -1265,7 +1265,7 @@ other objects like files.

 See also C<guestfs_stat>.");

-  ("pvcreate", (RErr, [String "device"]), 39, [],
+  ("pvcreate", (RErr, [Device "device"]), 39, [],
    [InitEmpty, Always, TestOutputListOfDevices (
       [["sfdiskM"; "/dev/sda"; ",100 ,200 ,"];
        ["pvcreate"; "/dev/sda1"];
@@ -1313,7 +1313,7 @@ from the non-empty list of physical volumes C<physvols>.");
 This creates an LVM volume group called C<logvol>
 on the volume group C<volgroup>, with C<size> megabytes.");

-  ("mkfs", (RErr, [String "fstype"; String "device"]), 42, [],
+  ("mkfs", (RErr, [String "fstype"; Device "device"]), 42, [],
    [InitEmpty, Always, TestOutput (
       [["sfdiskM"; "/dev/sda"; ","];
        ["mkfs"; "ext2"; "/dev/sda1"];
@@ -1326,7 +1326,7 @@ This creates a filesystem on C<device> (usually a partition
 or LVM logical volume).  The filesystem type is C<fstype>, for
 example C<ext3>.");

-  ("sfdisk", (RErr, [String "device";
+  ("sfdisk", (RErr, [Device "device";
                      Int "cyls"; Int "heads"; Int "sectors";
                      StringList "lines"]), 43, [DangerWillRobinson],
    [],
@@ -1647,7 +1647,7 @@ manpage for more details.  The list of fields returned isn't
 clearly defined, and depends on both the version of C<tune2fs>
 that libguestfs was built against, and the filesystem itself.");

-  ("blockdev_setro", (RErr, [String "device"]), 56, [],
+  ("blockdev_setro", (RErr, [Device "device"]), 56, [],
    [InitEmpty, Always, TestOutputTrue (
       [["blockdev_setro"; "/dev/sda"];
        ["blockdev_getro"; "/dev/sda"]])],
@@ -1657,7 +1657,7 @@ Sets the block device named C<device> to read-only.

 This uses the L<blockdev(8)> command.");

-  ("blockdev_setrw", (RErr, [String "device"]), 57, [],
+  ("blockdev_setrw", (RErr, [Device "device"]), 57, [],
    [InitEmpty, Always, TestOutputFalse (
       [["blockdev_setrw"; "/dev/sda"];
        ["blockdev_getro"; "/dev/sda"]])],
@@ -1667,7 +1667,7 @@ Sets the block device named C<device> to read-write.

 This uses the L<blockdev(8)> command.");

-  ("blockdev_getro", (RBool "ro", [String "device"]), 58, [],
+  ("blockdev_getro", (RBool "ro", [Device "device"]), 58, [],
    [InitEmpty, Always, TestOutputTrue (
       [["blockdev_setro"; "/dev/sda"];
        ["blockdev_getro"; "/dev/sda"]])],
@@ -1678,7 +1678,7 @@ Returns a boolean indicating if the block device is read-only

 This uses the L<blockdev(8)> command.");

-  ("blockdev_getss", (RInt "sectorsize", [String "device"]), 59, [],
+  ("blockdev_getss", (RInt "sectorsize", [Device "device"]), 59, [],
    [InitEmpty, Always, TestOutputInt (
       [["blockdev_getss"; "/dev/sda"]], 512)],
    "get sectorsize of block device",
@@ -1691,7 +1691,7 @@ for that).

 This uses the L<blockdev(8)> command.");

-  ("blockdev_getbsz", (RInt "blocksize", [String "device"]), 60, [],
+  ("blockdev_getbsz", (RInt "blocksize", [Device "device"]), 60, [],
    [InitEmpty, Always, TestOutputInt (
       [["blockdev_getbsz"; "/dev/sda"]], 4096)],
    "get blocksize of block device",
@@ -1703,7 +1703,7 @@ I<filesystem block size>).

 This uses the L<blockdev(8)> command.");

-  ("blockdev_setbsz", (RErr, [String "device"; Int "blocksize"]), 61, [],
+  ("blockdev_setbsz", (RErr, [Device "device"; Int "blocksize"]), 61, [],
    [], (* XXX test *)
    "set blocksize of block device",
    "\
@@ -1714,7 +1714,7 @@ I<filesystem block size>).

 This uses the L<blockdev(8)> command.");

-  ("blockdev_getsz", (RInt64 "sizeinsectors", [String "device"]), 62, [],
+  ("blockdev_getsz", (RInt64 "sizeinsectors", [Device "device"]), 62, [],
    [InitEmpty, Always, TestOutputInt (
       [["blockdev_getsz"; "/dev/sda"]], 1024000)],
    "get total size of device in 512-byte sectors",
@@ -1728,7 +1728,7 @@ useful I<size in bytes>.

 This uses the L<blockdev(8)> command.");

-  ("blockdev_getsize64", (RInt64 "sizeinbytes", [String "device"]), 63, [],
+  ("blockdev_getsize64", (RInt64 "sizeinbytes", [Device "device"]), 63, [],
    [InitEmpty, Always, TestOutputInt (
       [["blockdev_getsize64"; "/dev/sda"]], 524288000)],
    "get total size of device in bytes",
@@ -1739,7 +1739,7 @@ See also C<guestfs_blockdev_getsz>.

 This uses the L<blockdev(8)> command.");

-  ("blockdev_flushbufs", (RErr, [String "device"]), 64, [],
+  ("blockdev_flushbufs", (RErr, [Device "device"]), 64, [],
    [InitEmpty, Always, TestRun
       [["blockdev_flushbufs"; "/dev/sda"]]],
    "flush device buffers",
@@ -1749,7 +1749,7 @@ with C<device>.

 This uses the L<blockdev(8)> command.");

-  ("blockdev_rereadpt", (RErr, [String "device"]), 65, [],
+  ("blockdev_rereadpt", (RErr, [Device "device"]), 65, [],
    [InitEmpty, Always, TestRun
       [["blockdev_rereadpt"; "/dev/sda"]]],
    "reread partition table",
@@ -1890,7 +1890,7 @@ it to local file C<tarball>.

 To download an uncompressed tarball, use C<guestfs_tar_out>.");

-  ("mount_ro", (RErr, [String "device"; String "mountpoint"]), 73, [],
+  ("mount_ro", (RErr, [Device "device"; String "mountpoint"]), 73, [],
    [InitBasicFS, Always, TestLastFail (
       [["umount"; "/"];
        ["mount_ro"; "/dev/sda1"; "/"];
@@ -1905,7 +1905,7 @@ To download an uncompressed tarball, use C<guestfs_tar_out>.");
 This is the same as the C<guestfs_mount> command, but it
 mounts the filesystem with the read-only (I<-o ro>) flag.");

-  ("mount_options", (RErr, [String "options"; String "device"; String "mountpoint"]), 74, [],
+  ("mount_options", (RErr, [String "options"; Device "device"; String "mountpoint"]), 74, [],
    [],
    "mount a guest disk with mount options",
    "\
@@ -1913,7 +1913,7 @@ This is the same as the C<guestfs_mount> command, but it
 allows you to set the mount options as for the
 L<mount(8)> I<-o> flag.");

-  ("mount_vfs", (RErr, [String "options"; String "vfstype"; String "device"; String "mountpoint"]), 75, [],
+  ("mount_vfs", (RErr, [String "options"; String "vfstype"; Device "device"; String "mountpoint"]), 75, [],
    [],
    "mount a guest disk with mount options and vfstype",
    "\
@@ -1933,7 +1933,7 @@ There is no comprehensive help for this command.  You have
 to look at the file C<daemon/debug.c> in the libguestfs source
 to find out what you can do.");

-  ("lvremove", (RErr, [String "device"]), 77, [],
+  ("lvremove", (RErr, [Device "device"]), 77, [],
    [InitEmpty, Always, TestOutputList (
       [["sfdiskM"; "/dev/sda"; ","];
        ["pvcreate"; "/dev/sda1"];
@@ -1990,7 +1990,7 @@ Remove an LVM volume group C<vgname>, (for example C<VG>).
 This also forcibly removes all logical volumes in the volume
 group (if any).");

-  ("pvremove", (RErr, [String "device"]), 79, [],
+  ("pvremove", (RErr, [Device "device"]), 79, [],
    [InitEmpty, Always, TestOutputListOfDevices (
       [["sfdiskM"; "/dev/sda"; ","];
        ["pvcreate"; "/dev/sda1"];
@@ -2027,7 +2027,7 @@ The implementation uses the C<pvremove> command which refuses to
 wipe physical volumes that contain any volume groups, so you have
 to remove those first.");

-  ("set_e2label", (RErr, [String "device"; String "label"]), 80, [],
+  ("set_e2label", (RErr, [Device "device"; String "label"]), 80, [],
    [InitBasicFS, Always, TestOutput (
       [["set_e2label"; "/dev/sda1"; "testlabel"];
        ["get_e2label"; "/dev/sda1"]], "testlabel")],
@@ -2040,14 +2040,14 @@ C<device> to C<label>.  Filesystem labels are limited to
 You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label>
 to return the existing label on a filesystem.");

-  ("get_e2label", (RString "label", [String "device"]), 81, [],
+  ("get_e2label", (RString "label", [Device "device"]), 81, [],
    [],
    "get the ext2/3/4 filesystem label",
    "\
 This returns the ext2/3/4 filesystem label of the filesystem on
 C<device>.");

-  ("set_e2uuid", (RErr, [String "device"; String "uuid"]), 82, [],
+  ("set_e2uuid", (RErr, [Device "device"; String "uuid"]), 82, [],
    [InitBasicFS, Always, TestOutput (
       [["set_e2uuid"; "/dev/sda1"; "a3a61220-882b-4f61-89f4-cf24dcc7297d"];
        ["get_e2uuid"; "/dev/sda1"]], "a3a61220-882b-4f61-89f4-cf24dcc7297d");
@@ -2069,14 +2069,14 @@ L<tune2fs(8)> manpage.
 You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid>
 to return the existing UUID of a filesystem.");

-  ("get_e2uuid", (RString "uuid", [String "device"]), 83, [],
+  ("get_e2uuid", (RString "uuid", [Device "device"]), 83, [],
    [],
    "get the ext2/3/4 filesystem UUID",
    "\
 This returns the ext2/3/4 filesystem UUID of the filesystem on
 C<device>.");

-  ("fsck", (RInt "status", [String "fstype"; String "device"]), 84, [],
+  ("fsck", (RInt "status", [String "fstype"; Device "device"]), 84, [],
    [InitBasicFS, Always, TestOutputInt (
       [["umount"; "/dev/sda1"];
        ["fsck"; "ext2"; "/dev/sda1"]], 0);
@@ -2114,7 +2114,7 @@ Checking or repairing NTFS volumes is not supported

 This command is entirely equivalent to running C<fsck -a -t fstype device>.");

-  ("zero", (RErr, [String "device"]), 85, [],
+  ("zero", (RErr, [Device "device"]), 85, [],
    [InitBasicFS, Always, TestOutput (
       [["umount"; "/dev/sda1"];
        ["zero"; "/dev/sda1"];
@@ -2129,7 +2129,7 @@ any partition tables, filesystem superblocks and so on.

 See also: C<guestfs_scrub_device>.");

-  ("grub_install", (RErr, [String "root"; String "device"]), 86, [],
+  ("grub_install", (RErr, [String "root"; Device "device"]), 86, [],
    (* Test disabled because grub-install incompatible with virtio-blk driver.
     * See also: https://bugzilla.redhat.com/show_bug.cgi?id=479760
     *)
@@ -2284,7 +2284,7 @@ The returned strings are transcoded to UTF-8.");
 This runs C<hexdump -C> on the given C<path>.  The result is
 the human-readable, canonical hex dump of the file.");

-  ("zerofree", (RErr, [String "device"]), 97, [],
+  ("zerofree", (RErr, [Device "device"]), 97, [],
    [InitNone, Always, TestOutput (
       [["sfdiskM"; "/dev/sda"; ","];
        ["mkfs"; "ext3"; "/dev/sda1"];
@@ -2307,14 +2307,14 @@ mounted.
 It is possible that using this program can damage the filesystem
 or data on the filesystem.");

-  ("pvresize", (RErr, [String "device"]), 98, [],
+  ("pvresize", (RErr, [Device "device"]), 98, [],
    [],
    "resize an LVM physical volume",
    "\
 This resizes (expands or shrinks) an existing LVM physical
 volume to match the new size of the underlying device.");

-  ("sfdisk_N", (RErr, [String "device"; Int "partnum";
+  ("sfdisk_N", (RErr, [Device "device"; Int "partnum";
                        Int "cyls"; Int "heads"; Int "sectors";
                        String "line"]), 99, [DangerWillRobinson],
    [],
@@ -2326,7 +2326,7 @@ partition C<n> (note: C<n> counts from 1).
 For other parameters, see C<guestfs_sfdisk>.  You should usually
 pass C<0> for the cyls/heads/sectors parameters.");

-  ("sfdisk_l", (RString "partitions", [String "device"]), 100, [],
+  ("sfdisk_l", (RString "partitions", [Device "device"]), 100, [],
    [],
    "display the partition table",
    "\
@@ -2334,7 +2334,7 @@ This displays the partition table on C<device>, in the
 human-readable output of the L<sfdisk(8)> command.  It is
 not intended to be parsed.");

-  ("sfdisk_kernel_geometry", (RString "partitions", [String "device"]), 101, [],
+  ("sfdisk_kernel_geometry", (RString "partitions", [Device "device"]), 101, [],
    [],
    "display the kernel geometry",
    "\
@@ -2343,7 +2343,7 @@ This displays the kernel's idea of the geometry of C<device>.
 The result is in human-readable format, and not designed to
 be parsed.");

-  ("sfdisk_disk_geometry", (RString "partitions", [String "device"]), 102, [],
+  ("sfdisk_disk_geometry", (RString "partitions", [Device "device"]), 102, [],
    [],
    "display the disk geometry from the partition table",
    "\
@@ -2382,7 +2382,7 @@ This command is the same as running C<vgchange -a y|n volgroups...>
 Note that if C<volgroups> is an empty list then B<all> volume groups
 are activated or deactivated.");

-  ("lvresize", (RErr, [String "device"; Int "mbytes"]), 105, [],
+  ("lvresize", (RErr, [Device "device"; Int "mbytes"]), 105, [],
    [InitNone, Always, TestOutput (
       [["sfdiskM"; "/dev/sda"; ","];
        ["pvcreate"; "/dev/sda1"];
@@ -2403,7 +2403,7 @@ This resizes (expands or shrinks) an existing LVM logical
 volume to C<mbytes>.  When reducing, data in the reduced part
 is lost.");

-  ("resize2fs", (RErr, [String "device"]), 106, [],
+  ("resize2fs", (RErr, [Device "device"]), 106, [],
    [], (* lvresize tests this *)
    "resize an ext2/ext3 filesystem",
    "\
@@ -2455,7 +2455,7 @@ an error.

 The returned list is sorted.");

-  ("e2fsck_f", (RErr, [String "device"]), 108, [],
+  ("e2fsck_f", (RErr, [Device "device"]), 108, [],
    [], (* lvresize tests this *)
    "check an ext2/ext3 filesystem",
    "\
@@ -2473,7 +2473,7 @@ This command is only needed because of C<guestfs_resize2fs>
    "\
 Sleep for C<secs> seconds.");

-  ("ntfs_3g_probe", (RInt "status", [Bool "rw"; String "device"]), 110, [],
+  ("ntfs_3g_probe", (RInt "status", [Bool "rw"; Device "device"]), 110, [],
    [InitNone, Always, TestOutputInt (
       [["sfdiskM"; "/dev/sda"; ","];
        ["mkfs"; "ntfs"; "/dev/sda1"];
@@ -2551,7 +2551,7 @@ It is just a wrapper around the C L<glob(3)> function
 with flags C<GLOB_MARK|GLOB_BRACE>.
 See that manual page for more details.");

-  ("scrub_device", (RErr, [String "device"]), 114, [DangerWillRobinson],
+  ("scrub_device", (RErr, [Device "device"]), 114, [DangerWillRobinson],
    [InitNone, Always, TestRun (	(* use /dev/sdc because it's smaller *)
       [["scrub_device"; "/dev/sdc"]])],
    "scrub (securely wipe) a device",
@@ -2751,7 +2751,7 @@ This command lets you mount C<file> (a filesystem image
 in a file) on a mount point.  It is entirely equivalent to
 the command C<mount -o loop file mountpoint>.");

-  ("mkswap", (RErr, [String "device"]), 130, [],
+  ("mkswap", (RErr, [Device "device"]), 130, [],
    [InitEmpty, Always, TestRun (
       [["sfdiskM"; "/dev/sda"; ","];
        ["mkswap"; "/dev/sda1"]])],
@@ -2759,7 +2759,7 @@ the command C<mount -o loop file mountpoint>.");
    "\
 Create a swap partition on C<device>.");

-  ("mkswap_L", (RErr, [String "label"; String "device"]), 131, [],
+  ("mkswap_L", (RErr, [String "label"; Device "device"]), 131, [],
    [InitEmpty, Always, TestRun (
       [["sfdiskM"; "/dev/sda"; ","];
        ["mkswap_L"; "hello"; "/dev/sda1"]])],
@@ -2771,7 +2771,7 @@ Note that you cannot attach a swap label to a block device
 (eg. C</dev/sda>), just to a partition.  This appears to be
 a limitation of the kernel or swap tools.");

-  ("mkswap_U", (RErr, [String "uuid"; String "device"]), 132, [],
+  ("mkswap_U", (RErr, [String "uuid"; Device "device"]), 132, [],
    [InitEmpty, Always, TestRun (
       [["sfdiskM"; "/dev/sda"; ","];
        ["mkswap_U"; "a3a61220-882b-4f61-89f4-cf24dcc7297d"; "/dev/sda1"]])],
@@ -2907,7 +2907,7 @@ This function is primarily intended for use by programs.  To
 get a simple list of names, use C<guestfs_ls>.  To get a printable
 directory for human consumption, use C<guestfs_ll>.");

-  ("sfdiskM", (RErr, [String "device"; StringList "lines"]), 139, [DangerWillRobinson],
+  ("sfdiskM", (RErr, [Device "device"; StringList "lines"]), 139, [DangerWillRobinson],
    [],
    "create partitions on a block device",
    "\
@@ -3213,7 +3213,7 @@ Do not confuse this with the guestfish-specific
 C<alloc> command which allocates a file in the host and
 attaches it as a device.");

-  ("swapon_device", (RErr, [String "device"]), 170, [],
+  ("swapon_device", (RErr, [Device "device"]), 170, [],
    [InitPartition, Always, TestRun (
       [["mkswap"; "/dev/sda1"];
        ["swapon_device"; "/dev/sda1"];
@@ -3232,7 +3232,7 @@ the guest doesn't want you to trash.  You also risk leaking
 information about the host to the guest this way.  Instead,
 attach a new host device to the guest and swap on that.");

-  ("swapoff_device", (RErr, [String "device"]), 171, [],
+  ("swapoff_device", (RErr, [Device "device"]), 171, [],
    [], (* XXX tested by swapon_device *)
    "disable swap on device",
    "\
-- 
1.6.4.337.g5420e


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]