X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fuse%2Fguestmount.c;h=e95b5a6f423d0293e747d018ef8ec8e81c51ead0;hb=8736015a2c3eab15ca431ed777586a995c56c581;hp=c935493b565e7a6b4fbe2773e3ded4f80aa7ea33;hpb=a6025c11d97ed5802b3729a93d224d2baa20ff12;p=libguestfs.git diff --git a/fuse/guestmount.c b/fuse/guestmount.c index c935493..e95b5a6 100644 --- a/fuse/guestmount.c +++ b/fuse/guestmount.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -40,6 +41,7 @@ #include #include #include +#include #include #include @@ -927,7 +929,7 @@ main (int argc, char *argv[]) struct mp *mps = NULL; struct mp *mp; char *p; - int c, i, r; + int c, r; int option_index; struct sigaction sa; @@ -1063,9 +1065,12 @@ main (int argc, char *argv[]) guestfs_set_verbose (g, verbose); break; - case 'V': - printf ("%s %s\n", program_name, PACKAGE_VERSION); + case 'V': { + struct guestfs_version *v = guestfs_version (g); + printf ("%s %"PRIi64".%"PRIi64".%"PRIi64"%s\n", program_name, + v->major, v->minor, v->release, v->extra); exit (EXIT_SUCCESS); + } case HELP_OPTION: usage (EXIT_SUCCESS); @@ -1160,10 +1165,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); }