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.
This commit is contained in:
Richard W.M. Jones
2012-08-18 22:08:29 +01:00
parent 781d72f558
commit d67e6ea75d
35 changed files with 67 additions and 67 deletions

View File

@@ -182,9 +182,9 @@ get_blkid_tag (const char *device, const char *tag)
<tr><td valign="top" style="padding-bottom: 1.5em;" colspan="2">
<pre>
<b>guestfish -N bootrootlv:/dev/VG/LV:ext4:ext4:10G:256M &lt;&lt;EOF</b>
<font style="color: green;">mount-options "" /dev/VG/LV /
<font style="color: green;">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</font>

View File

@@ -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)

View File

@@ -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"),

View File

@@ -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. */

View File

@@ -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) {

View File

@@ -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

View File

@@ -3001,12 +3001,12 @@ characters does I<not> 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<guestfs_mountpoints>" };
["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<guestfs_setcon>" };
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<device> with label C<label>." };
["part_add"; "/dev/sda"; "p"; "204800"; "-64"];
["mke2journal_U"; "4096"; uuid; "/dev/sda1"];
["mke2fs_JU"; "ext2"; "4096"; "/dev/sda2"; uuid];
["mount_options"; ""; "/dev/sda2"; "/"];
["mount"; "/dev/sda2"; "/"];
["write"; "/new"; "new file contents"];
["cat"; "/new"]], "new file contents")
]);
@@ -6811,7 +6811,7 @@ Rename a logical volume C<logvol> with the new name C<newlogvol>." };
["vg_activate"; "false"; "VG"];
["vgrename"; "VG"; "VG2"];
["vg_activate"; "true"; "VG2"];
["mount_options"; ""; "/dev/VG2/LV"; "/"];
["mount"; "/dev/VG2/LV"; "/"];
["vgs"]], ["VG2"])
];
shortdesc = "rename an LVM volume group";
@@ -7787,7 +7787,7 @@ See also C<guestfs_is_lv>, C<guestfs_canonical_device_name>." };
InitEmpty, Always, TestOutput (
[["part_disk"; "/dev/sda"; "mbr"];
["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["mount_options"; ""; "/dev/sda1"; "/"];
["mount"; "/dev/sda1"; "/"];
["write"; "/new"; "new file contents"];
["cat"; "/new"]], "new file contents")
];
@@ -9207,7 +9207,7 @@ call C<guestfs_max_disks>." };
InitEmpty, IfAvailable "xfs", TestOutputStruct (
[["part_disk"; "/dev/sda"; "mbr"];
["mkfs"; "xfs"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["mount_options"; ""; "/dev/sda1"; "/"];
["mount"; "/dev/sda1"; "/"];
["xfs_info"; "/"]],
[CompareWithInt ("xfs_blocksize", 4096);
])
@@ -9310,7 +9310,7 @@ in the returned structure is defined by the API." };
["lvcreate"; "LV"; "VG"; "40"];
["mkfs"; "xfs"; "/dev/VG/LV"; ""; "NOARG"; ""; ""];
["lvresize"; "/dev/VG/LV"; "80"];
["mount_options"; ""; "/dev/VG/LV"; "/"];
["mount"; "/dev/VG/LV"; "/"];
["xfs_growfs"; "/"; "true"; "false"; "false"; ""; ""; ""; ""; ""];
["xfs_info"; "/"]],
[CompareWithInt ("xfs_blocksize", 4096);

View File

@@ -629,7 +629,7 @@ Sys::Guestfs - Perl bindings for libguestfs
my $g = Sys::Guestfs->new ();
$g->add_drive_opts ('guest.img', format => 'raw');
$g->launch ();
$g->mount_options ('', '/dev/sda1', '/');
$g->mount ('/dev/sda1', '/');
$g->touch ('/hello');
$g->shutdown ();
$g->close ();

View File

@@ -453,7 +453,7 @@ and generate_one_test_body name i test_name init test =
["lvm_remove_all"];
["part_disk"; "/dev/sda"; "mbr"];
["mkfs"; "ext2"; "/dev/sda1"; ""; "NOARG"; ""; ""];
["mount_options"; ""; "/dev/sda1"; "/"]]
["mount"; "/dev/sda1"; "/"]]
| InitBasicFSonLVM ->
pr " /* InitBasicFSonLVM for %s: create ext2 on /dev/VG/LV */\n"
test_name;
@@ -466,7 +466,7 @@ and generate_one_test_body name i test_name init test =
["vgcreate"; "VG"; "/dev/sda1"];
["lvcreate"; "LV"; "VG"; "8"];
["mkfs"; "ext2"; "/dev/VG/LV"; ""; "NOARG"; ""; ""];
["mount_options"; ""; "/dev/VG/LV"; "/"]]
["mount"; "/dev/VG/LV"; "/"]]
| InitISOFS ->
pr " /* InitISOFS for %s */\n" test_name;
List.iter (generate_test_command_call test_name)
@@ -480,7 +480,7 @@ and generate_one_test_body name i test_name init test =
[["blockdev_setrw"; "/dev/sda"];
["umount_all"];
["lvm_remove_all"];
["mount_options"; ""; "/dev/sdb1"; "/"]]
["mount"; "/dev/sdb1"; "/"]]
);
let get_seq_last = function

View File

@@ -54,7 +54,7 @@ public class CreateDisk
g.mkfs ("ext4", partitions[0]);
// Now mount the filesystem so that we can add files.
g.mount_options ("", partitions[0], "/");
g.mount (partitions[0], "/");
// Create some files and directories.
g.touch ("/empty");

View File

@@ -44,7 +44,7 @@ let () =
g#mkfs "ext4" partitions.(0);
(* Now mount the filesystem so that we can add files. *)
g#mount_options "" partitions.(0) "/";
g#mount partitions.(0) "/";
(* Create some files and directories. *)
g#touch "/empty";

View File

@@ -42,7 +42,7 @@ let () =
failwith "Guestfs.lvs returned incorrect result";
g#mkfs "ext2" "/dev/VG/LV1";
g#mount_options "" "/dev/VG/LV1" "/";
g#mount "/dev/VG/LV1" "/";
g#mkdir "/p";
g#touch "/q";

View File

@@ -61,7 +61,7 @@ let () =
let lv = String.copy "/dev/VG/LV1" in
Guestfs.mkfs g s lv;
let s = String.copy "/" in
Guestfs.mount_options g "" lv s;
Guestfs.mount g lv s;
let s = String.copy "/test" in
Guestfs.touch g s;

View File

@@ -45,7 +45,7 @@ if (@partitions != 1) {
$g->mkfs ("ext4", $partitions[0]);
# Now mount the filesystem so that we can add files.
$g->mount_options ("", $partitions[0], "/");
$g->mount ($partitions[0], "/");
# Create some files and directories.
$g->touch ("/empty");

View File

@@ -11,7 +11,7 @@ guestfs-perl - How to use libguestfs from Perl
my $g = Sys::Guestfs->new ();
$g->add_drive_opts ('guest.img', format => 'raw');
$g->launch ();
$g->mount_options ('', '/dev/sda1', '/');
$g->mount ('/dev/sda1', '/');
$g->touch ('/hello');
$g->shutdown ();
$g->close ();

View File

@@ -977,7 +977,7 @@ sub mount_operating_system
if($ro) {
$g->mount_ro ($mounts->{$_}, $_)
} else {
$g->mount_options ("", $mounts->{$_}, $_)
$g->mount ($mounts->{$_}, $_)
}
}
}

View File

@@ -38,7 +38,7 @@ $g->part_disk ("/dev/sda", "mbr");
ok (1);
$g->mkfs ("ext2", "/dev/sda1");
ok (1);
$g->mount_options ("", "/dev/sda1", "/");
$g->mount ("/dev/sda1", "/");
ok (1);
$g->mkdir ("/p");
ok (1);

View File

@@ -44,7 +44,7 @@ ok (1);
$g->mkfs ("ext2", "/dev/sda1");
ok (1);
$g->mount_options ("", "/dev/sda1", "/");
$g->mount ("/dev/sda1", "/");
ok (1);
# Directory doesn't exist, so this mkdir should succeed.

View File

@@ -39,7 +39,7 @@ assert (len (partitions) == 1)
g.mkfs ("ext4", partitions[0])
# Now mount the filesystem so that we can add files.
g.mount_options ("", partitions[0], "/")
g.mount (partitions[0], "/")
# Create some files and directories.
g.touch ("/empty")

View File

@@ -1145,7 +1145,7 @@ let () =
* in order to resize it.
*)
assert (Array.length (g#mounts ()) = 0);
g#mount_options "" target "/";
g#mount target "/";
g#btrfs_filesystem_resize "/";
g#umount "/"
in

View File

@@ -42,7 +42,7 @@ end
g.mkfs("ext4", partitions[0])
# Now mount the filesystem so that we can add files.
g.mount_options("", partitions[0], "/")
g.mount(partitions[0], "/")
# Create some files and directories.
g.touch("/empty")

View File

@@ -270,7 +270,7 @@ let () =
g#zero_device fs
) else (
let mounted =
try g#mount_options "" fs "/"; true
try g#mount fs "/"; true
with _ -> false in
if mounted then (

View File

@@ -26,9 +26,9 @@ rm -f test1.img test2.img
../fish/guestfish \
-N bootrootlv:/dev/VG/LV:ext2:ext4:400M:32M:gpt <<EOF
mount-options "" /dev/VG/LV /
mount /dev/VG/LV /
mkdir /boot
mount-options "" /dev/sda1 /boot
mount /dev/sda1 /boot
fill 1 300M /big
fill 1 10M /boot/big
sync

View File

@@ -143,12 +143,12 @@ NAMING> below.
Before you can read or write files, create directories and so on in a
disk image that contains filesystems, you have to mount those
filesystems using L</guestfs_mount_options> or L</guestfs_mount_ro>.
filesystems using L</guestfs_mount> or L</guestfs_mount_ro>.
If you already know that a disk image contains (for example) one
partition with a filesystem on that partition, then you can mount it
directly:
guestfs_mount_options (g, "", "/dev/sda1", "/");
guestfs_mount (g, "/dev/sda1", "/");
where C</dev/sda1> means literally the first partition (C<1>) of the
first disk image that we added (C</dev/sda>). If the disk contains
@@ -632,7 +632,7 @@ return a hash table like this example:
/ => /dev/vg_guest/lv_root
/usr => /dev/vg_guest/lv_usr
The caller can then make calls to L</guestfs_mount_options> to
The caller can then make calls to L</guestfs_mount> to
mount the filesystems as suggested.
Be careful to mount filesystems in the right order (eg. C</> before

View File

@@ -241,7 +241,7 @@ main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
if (guestfs_mount_options (g, "", "/dev/sda1", "/") == -1) {
if (guestfs_mount (g, "/dev/sda1", "/") == -1) {
fprintf (stderr,
_("libguestfs-test-tool: failed to mount /dev/sda1 on /\n"));
exit (EXIT_FAILURE);

View File

@@ -104,7 +104,7 @@ main (int argc, char *argv[])
exit (EXIT_FAILURE);
/* Mount it writable and test some other errors. */
if (guestfs_mount_options (g, "", "/dev/sda1", "/") == -1)
if (guestfs_mount (g, "/dev/sda1", "/") == -1)
exit (EXIT_FAILURE);
stat = guestfs_lstat (g, "/nosuchfile");

View File

@@ -126,7 +126,7 @@ main (int argc, char *argv[])
if (guestfs_mkfs (g, "ext2", "/dev/sda1") == -1)
exit (EXIT_FAILURE);
if (guestfs_mount_options (g, "", "/dev/sda1", "/") == -1)
if (guestfs_mount (g, "/dev/sda1", "/") == -1)
exit (EXIT_FAILURE);
/*----- Upload cancellation test -----*/

View File

@@ -63,15 +63,15 @@ mkfs ext2 /dev/debian/home blocksize:4096
set-e2uuid /dev/debian/home 01234567-0123-0123-0123-012345678905
# Enough to fool inspection API.
mount-options "" /dev/debian/root /
mount /dev/debian/root /
mkdir /boot
mount-options "" /dev/sda1 /boot
mount /dev/sda1 /boot
mkdir /usr
mount-options "" /dev/debian/usr /usr
mount /dev/debian/usr /usr
mkdir /var
mount-options "" /dev/debian/var /var
mount /dev/debian/var /var
mkdir /home
mount-options "" /dev/debian/home /home
mount /dev/debian/home /home
mkdir /bin
mkdir /etc
mkdir-p /var/lib/dpkg

View File

@@ -135,9 +135,9 @@ $g->set_label ('/dev/VG/Root', 'ROOT');
$g->set_e2uuid ('/dev/VG/Root', '01234567-0123-0123-0123-012345678902');
# Enough to fool inspection API.
$g->mount_options ('', '/dev/VG/Root', '/');
$g->mount ('/dev/VG/Root', '/');
$g->mkdir ('/boot');
$g->mount_options ('', $bootdev, '/boot');
$g->mount ($bootdev, '/boot');
$g->mkdir ('/bin');
$g->mkdir ('/etc');
$g->mkdir ('/etc/sysconfig');

View File

@@ -58,9 +58,9 @@ mkfs ext2 /dev/sda2 blocksize:4096
set-e2uuid /dev/sda2 01234567-0123-0123-0123-012345678902
# Enough to fool inspection API.
mount-options "" /dev/sda2 /
mount /dev/sda2 /
mkdir /boot
mount-options "" /dev/sda1 /boot
mount /dev/sda1 /boot
mkdir /bin
mkdir /etc
mkdir /home

View File

@@ -55,7 +55,7 @@ mkfs ntfs /dev/sda1
mkfs ntfs /dev/sda2
# Enough to fool inspection API.
mount-options "" /dev/sda2 /
mount /dev/sda2 /
mkdir-p /Windows/System32/Config
upload $SRCDIR/guest-aux/windows-software /Windows/System32/Config/SOFTWARE

View File

@@ -60,7 +60,7 @@ EOF
$guestfish -a test1.img -a test2.img <<'EOF'
run
mount-options "" /dev/VG/Root /
mount /dev/VG/Root /
upload test.fstab /etc/fstab
EOF

View File

@@ -51,7 +51,7 @@ EOF
$guestfish -a test1.qcow2 <<'EOF'
run
mount-options "" /dev/VG/Root /
mount /dev/VG/Root /
upload test.fstab /etc/fstab
EOF
@@ -83,7 +83,7 @@ EOF
$guestfish -a test1.qcow2 <<'EOF'
run
mount-options "" /dev/VG/Root /
mount /dev/VG/Root /
upload test.fstab /etc/fstab
EOF
@@ -114,7 +114,7 @@ EOF
$guestfish -a test1.qcow2 <<'EOF'
run
mount-options "" /dev/VG/Root /
mount /dev/VG/Root /
upload test.fstab /etc/fstab
EOF

View File

@@ -38,7 +38,7 @@ run
part-disk /dev/sda mbr
mkfs ext2 /dev/sda1
mount-options "" /dev/sda1 /
mount /dev/sda1 /
fallocate64 /file $size

View File

@@ -51,11 +51,11 @@ lvcreate LV VG 80
mkfs ext3 /dev/VG/LV
mkmountpoint /a
mount-options "" /dev/sda1 /a
mount /dev/sda1 /a
mkmountpoint /b
mount-options "" /dev/sdb1 /b
mount /dev/sdb1 /b
mkmountpoint /c
mount-options "" /dev/VG/LV /c
mount /dev/VG/LV /c
write /a/test "This is a test"
write /b/test "This is a test"