mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
fuse: Allow specifying the fstype of a mount
This commit is contained in:
committed by
Richard W.M. Jones
parent
bec7888be3
commit
f83df69bec
@@ -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);
|
||||
|
||||
@@ -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; \
|
||||
|
||||
Reference in New Issue
Block a user