From d67e6ea75dde6309ce4c6162a4a0429ab8d6709b Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 18 Aug 2012 22:08:29 +0100 Subject: Replace mount-options with mount where appropriate. Since our minimum supported version is now 1.16 and mount was fixed in 1.13.16, it is now safe to replace mount-options + empty options with mount wherever it occurs. --- contrib/intro/libguestfs-intro.html | 4 +-- edit/virt-edit.c | 2 +- erlang/examples/create_disk.erl | 2 +- examples/create_disk.c | 2 +- fish/inspect.c | 2 +- fish/test-remote.sh | 2 +- generator/generator_actions.ml | 34 +++++++++++----------- generator/generator_perl.ml | 2 +- generator/generator_tests_c_api.ml | 6 ++-- java/examples/CreateDisk.java | 2 +- ocaml/examples/create_disk.ml | 2 +- ocaml/t/guestfs_010_basic.ml | 2 +- ocaml/t/guestfs_070_threads.ml | 2 +- perl/examples/create_disk.pl | 2 +- perl/examples/guestfs-perl.pod | 2 +- perl/lib/Sys/Guestfs/Lib.pm | 2 +- perl/t/060-readdir.t | 2 +- perl/t/810-mkdir-eexist.t | 2 +- python/examples/create_disk.py | 2 +- resize/resize.ml | 2 +- ruby/examples/create_disk.rb | 2 +- sparsify/sparsify.ml | 2 +- sparsify/test-virt-sparsify.sh | 4 +-- src/guestfs.pod | 6 ++-- test-tool/test-tool.c | 2 +- tests/c-api/test-last-errno.c | 2 +- tests/c-api/test-user-cancel.c | 2 +- tests/guests/guest-aux/make-debian-img.sh | 10 +++---- tests/guests/guest-aux/make-fedora-img.pl | 4 +-- tests/guests/guest-aux/make-ubuntu-img.sh | 4 +-- tests/guests/guest-aux/make-windows-img.sh | 2 +- tests/md/test-inspect-fstab-md.sh | 2 +- tests/md/test-inspect-fstab.sh | 6 ++-- .../test-cancellation-download-librarycancels.sh | 2 +- tests/qemu/qemu-snapshot-isolation.sh | 6 ++-- 35 files changed, 67 insertions(+), 67 deletions(-) diff --git a/contrib/intro/libguestfs-intro.html b/contrib/intro/libguestfs-intro.html index fe1e833b..380e290b 100644 --- a/contrib/intro/libguestfs-intro.html +++ b/contrib/intro/libguestfs-intro.html @@ -182,9 +182,9 @@ get_blkid_tag (const char *device, const char *tag)
 guestfish -N bootrootlv:/dev/VG/LV:ext4:ext4:10G:256M <<EOF
-  mount-options "" /dev/VG/LV /
+  mount /dev/VG/LV /
   mkdir /boot
-  mount-options "" /dev/sda1 /boot
+  mount /dev/sda1 /boot
   txz-in filesystem.tar.xz /
   write /etc/HOSTNAME "test01.example.com\n"
   upload /etc/resolv.conf /etc/resolv.conf
diff --git a/edit/virt-edit.c b/edit/virt-edit.c
index 3d23da86..3627ab8f 100644
--- a/edit/virt-edit.c
+++ b/edit/virt-edit.c
@@ -686,7 +686,7 @@ mount_drive_letter (char drive_letter, const char *root)
   if (guestfs_umount_all (g) == -1)
     exit (EXIT_FAILURE);
 
-  if (guestfs_mount_options (g, "", device, "/") == -1)
+  if (guestfs_mount (g, device, "/") == -1)
     exit (EXIT_FAILURE);
 
   for (i = 0; drives[i] != NULL; ++i)
diff --git a/erlang/examples/create_disk.erl b/erlang/examples/create_disk.erl
index d192435a..021c37fc 100755
--- a/erlang/examples/create_disk.erl
+++ b/erlang/examples/create_disk.erl
@@ -39,7 +39,7 @@ main(_) ->
     ok = guestfs:mkfs(G, "ext4", Partition),
 
     % Now mount the filesystem so that we can add files. *)
-    ok = guestfs:mount_options(G, "", Partition, "/"),
+    ok = guestfs:mount(G, Partition, "/"),
 
     % Create some files and directories. *)
     ok = guestfs:touch(G, "/empty"),
diff --git a/examples/create_disk.c b/examples/create_disk.c
index e314328f..620efedd 100644
--- a/examples/create_disk.c
+++ b/examples/create_disk.c
@@ -81,7 +81,7 @@ main (int argc, char *argv[])
     exit (EXIT_FAILURE);
 
   /* Now mount the filesystem so that we can add files. */
-  if (guestfs_mount_options (g, "", partitions[0], "/") == -1)
+  if (guestfs_mount (g, partitions[0], "/") == -1)
     exit (EXIT_FAILURE);
 
   /* Create some files and directories. */
diff --git a/fish/inspect.c b/fish/inspect.c
index 64c66070..b71c4d72 100644
--- a/fish/inspect.c
+++ b/fish/inspect.c
@@ -152,7 +152,7 @@ inspect_mount_root (const char *root)
   for (i = 0; mountpoints[i] != NULL; i += 2) {
     int r;
     if (!read_only)
-      r = guestfs_mount_options (g, "", mountpoints[i+1], mountpoints[i]);
+      r = guestfs_mount (g, mountpoints[i+1], mountpoints[i]);
     else
       r = guestfs_mount_ro (g, mountpoints[i+1], mountpoints[i]);
     if (r == -1) {
diff --git a/fish/test-remote.sh b/fish/test-remote.sh
index a0010321..64a3b375 100755
--- a/fish/test-remote.sh
+++ b/fish/test-remote.sh
@@ -28,7 +28,7 @@ eval `./guestfish --listen`
 ./guestfish --remote run
 ./guestfish --remote part-disk /dev/sda mbr
 ./guestfish --remote mkfs ext2 /dev/sda1
-./guestfish --remote mount-options "" /dev/sda1 /
+./guestfish --remote mount /dev/sda1 /
 
 # Failure of the above commands will cause the guestfish listener to exit.
 # Incorrect return from echo_daemon will not, so need to ensure the listener
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index bb5aa2ae..d45558dd 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -3001,12 +3001,12 @@ characters does I work, even if the length is specified." };
       InitEmpty, Always, TestOutputListOfDevices (
         [["part_disk"; "/dev/sda"; "mbr"];
          ["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
-         ["mount_options"; ""; "/dev/sda1"; "/"];
+         ["mount"; "/dev/sda1"; "/"];
          ["mounts"]], ["/dev/sda1"]);
       InitEmpty, Always, TestOutputList (
         [["part_disk"; "/dev/sda"; "mbr"];
          ["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
-         ["mount_options"; ""; "/dev/sda1"; "/"];
+         ["mount"; "/dev/sda1"; "/"];
          ["umount"; "/"; "false"; "false"];
          ["mounts"]], [])
     ];
@@ -3051,11 +3051,11 @@ See also: C" };
          ["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
          ["mkfs"; "ext2"; "/dev/sda2"; ""; "NOARG"; ""; ""];
          ["mkfs"; "ext2"; "/dev/sda3"; ""; "NOARG"; ""; ""];
-         ["mount_options"; ""; "/dev/sda1"; "/"];
+         ["mount"; "/dev/sda1"; "/"];
          ["mkdir"; "/mp1"];
-         ["mount_options"; ""; "/dev/sda2"; "/mp1"];
+         ["mount"; "/dev/sda2"; "/mp1"];
          ["mkdir"; "/mp1/mp2"];
-         ["mount_options"; ""; "/dev/sda3"; "/mp1/mp2"];
+         ["mount"; "/dev/sda3"; "/mp1/mp2"];
          ["mkdir"; "/mp1/mp2/mp3"];
          ["umount_all"];
          ["mounts"]], [])
@@ -4332,11 +4332,11 @@ the human-readable, canonical hex dump of the file." };
       InitNone, Always, TestOutput (
         [["part_disk"; "/dev/sda"; "mbr"];
          ["mkfs"; "ext3"; "/dev/sda1"; ""; "NOARG"; ""; ""];
-         ["mount_options"; ""; "/dev/sda1"; "/"];
+         ["mount"; "/dev/sda1"; "/"];
          ["write"; "/new"; "test file"];
          ["umount"; "/dev/sda1"; "false"; "false"];
          ["zerofree"; "/dev/sda1"];
-         ["mount_options"; ""; "/dev/sda1"; "/"];
+         ["mount"; "/dev/sda1"; "/"];
          ["cat"; "/new"]], "test file")
     ];
     shortdesc = "zero unused inodes and disk blocks on ext2/3 filesystem";
@@ -4456,7 +4456,7 @@ are activated or deactivated." };
          ["vgcreate"; "VG"; "/dev/sda1"];
          ["lvcreate"; "LV"; "VG"; "10"];
          ["mkfs"; "ext2"; "/dev/VG/LV"; ""; "NOARG"; ""; ""];
-         ["mount_options"; ""; "/dev/VG/LV"; "/"];
+         ["mount"; "/dev/VG/LV"; "/"];
          ["write"; "/new"; "test content"];
          ["umount"; "/"; "false"; "false"];
          ["lvresize"; "/dev/VG/LV"; "20"];
@@ -4464,7 +4464,7 @@ are activated or deactivated." };
          ["e2fsck"; "/dev/VG/LV"; "true"; "false"];
          ["e2fsck"; "/dev/VG/LV"; "false"; "true"];
          ["resize2fs"; "/dev/VG/LV"];
-         ["mount_options"; ""; "/dev/VG/LV"; "/"];
+         ["mount"; "/dev/VG/LV"; "/"];
          ["cat"; "/new"]], "test content");
       InitNone, Always, TestRun (
         (* Make an LV smaller to test RHBZ#587484. *)
@@ -5935,7 +5935,7 @@ and C" };
       InitEmpty, Always, TestOutput (
         [["part_disk"; "/dev/sda"; "mbr"];
          ["mkfs_b"; "ext2"; "4096"; "/dev/sda1"];
-         ["mount_options"; ""; "/dev/sda1"; "/"];
+         ["mount"; "/dev/sda1"; "/"];
          ["write"; "/new"; "new file contents"];
          ["cat"; "/new"]], "new file contents");
       InitEmpty, Always, TestRun (
@@ -5972,7 +5972,7 @@ the requested cluster size." };
          ["part_add"; "/dev/sda"; "p"; "204800"; "-64"];
          ["mke2journal"; "4096"; "/dev/sda1"];
          ["mke2fs_J"; "ext2"; "4096"; "/dev/sda2"; "/dev/sda1"];
-         ["mount_options"; ""; "/dev/sda2"; "/"];
+         ["mount"; "/dev/sda2"; "/"];
          ["write"; "/new"; "new file contents"];
          ["cat"; "/new"]], "new file contents")
     ];
@@ -5994,7 +5994,7 @@ to the command:
          ["part_add"; "/dev/sda"; "p"; "204800"; "-64"];
          ["mke2journal_L"; "4096"; "JOURNAL"; "/dev/sda1"];
          ["mke2fs_JL"; "ext2"; "4096"; "/dev/sda2"; "JOURNAL"];
-         ["mount_options"; ""; "/dev/sda2"; "/"];
+         ["mount"; "/dev/sda2"; "/"];
          ["write"; "/new"; "new file contents"];
          ["cat"; "/new"]], "new file contents")
     ];
@@ -6015,7 +6015,7 @@ This creates an ext2 external journal on C with label C