diff options
author | Richard Jones <rjones@redhat.com> | 2010-02-09 18:00:24 +0000 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2010-02-10 10:46:23 +0000 |
commit | f93cbe5756cf052cce8049087afdcf714a3fc70c (patch) | |
tree | c8caeeeb48f4293aa3aa7781fa3ae013b146728a /fish | |
parent | 245ac5673700f54479e9408e8659cb68f80c344a (diff) | |
download | libguestfs-f93cbe5756cf052cce8049087afdcf714a3fc70c.tar.gz libguestfs-f93cbe5756cf052cce8049087afdcf714a3fc70c.tar.xz libguestfs-f93cbe5756cf052cce8049087afdcf714a3fc70c.zip |
Use mount-options instead of mount to avoid implicit -o sync.
guestfs_mount adds -o sync implicitly. This causes a very large
performance problem for write-intensive programs (eg. virt-v2v).
Document this as a "gotcha".
Change the tests, guestfish, Sys::Guestfs::Lib, guestmount to use
mount-options instead.
(Note that this gotcha does not affect mount-ro).
The source of the performance problem was first identified by
Matthew Booth.
Diffstat (limited to 'fish')
-rw-r--r-- | fish/fish.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fish/fish.c b/fish/fish.c index dd73af74..32d6f9f1 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -474,10 +474,13 @@ mount_mps (struct mp *mp) if (mp) { mount_mps (mp->next); - if (!read_only) - r = guestfs_mount (g, mp->device, mp->mountpoint); - else - r = guestfs_mount_ro (g, mp->device, mp->mountpoint); + + /* Don't use guestfs_mount here because that will default to mount + * options -o sync,noatime. For more information, see guestfs(3) + * section "LIBGUESTFS GOTCHAS". + */ + const char *options = read_only ? "ro" : ""; + r = guestfs_mount_options (g, options, mp->device, mp->mountpoint); if (r == -1) exit (EXIT_FAILURE); } |