fuse: Allow specifying the fstype of a mount

This commit is contained in:
Dave Vasilevsky
2013-05-08 21:02:21 -04:00
committed by Richard W.M. Jones
parent bec7888be3
commit f83df69bec
2 changed files with 15 additions and 1 deletions

View File

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

View File

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