From f83df69bec28fe5414da3896af0ec3b0986beaa4 Mon Sep 17 00:00:00 2001 From: Dave Vasilevsky Date: Wed, 8 May 2013 21:02:21 -0400 Subject: [PATCH] fuse: Allow specifying the fstype of a mount --- fish/options.c | 8 +++++++- fish/options.h | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/fish/options.c b/fish/options.c index 94a4cb4c3..db3077249 100644 --- a/fish/options.c +++ b/fish/options.c @@ -406,7 +406,13 @@ mount_mps (struct mp *mp) else options = ""; - r = guestfs_mount_options (g, options, mp->device, mp->mountpoint); + if (mp->fstype) { + r = guestfs_mount_vfs (g, options, mp->fstype, mp->device, + mp->mountpoint); + } else { + r = guestfs_mount_options (g, options, mp->device, + mp->mountpoint); + } if (r == -1) { display_mountpoints_on_failure (mp->device, mp->options); exit (EXIT_FAILURE); diff --git a/fish/options.h b/fish/options.h index ed1325cd3..bdfabb202 100644 --- a/fish/options.h +++ b/fish/options.h @@ -89,6 +89,7 @@ struct mp { char *device; char *mountpoint; char *options; + char *fstype; }; /* in config.c */ @@ -142,6 +143,7 @@ extern int add_libvirt_drives (const char *guest); perror ("malloc"); \ exit (EXIT_FAILURE); \ } \ + mp->fstype = NULL; \ mp->options = NULL; \ mp->mountpoint = (char *) "/"; \ p = strchr (optarg, ':'); \ @@ -154,6 +156,12 @@ extern int add_libvirt_drives (const char *guest); *p = '\0'; \ p++; \ mp->options = p; \ + p = strchr (p, ':'); \ + if (p) { \ + *p = '\0'; \ + p++; \ + mp->fstype = p; \ + } \ } \ } \ mp->device = optarg; \