/* Takes optional arguments, consult optargs_bitmask. */
int
-do_mkfs_opts (const char *fstype, const char *device, int blocksize)
+do_mkfs_opts (const char *fstype, const char *device, int blocksize, const char *features)
{
const char *argv[MAX_ARGS];
size_t i = 0;
}
}
+ if (optargs_bitmask & GUESTFS_MKFS_OPTS_FEATURES_BITMASK) {
+ argv[i++] = "-O";
+ argv[i++] = features;
+ }
+
argv[i++] = device;
argv[i++] = NULL;
do_mkfs (const char *fstype, const char *device)
{
optargs_bitmask = 0;
- return do_mkfs_opts (fstype, device, 0);
+ return do_mkfs_opts (fstype, device, 0, 0);
}
int
do_mkfs_b (const char *fstype, int blocksize, const char *device)
{
optargs_bitmask = GUESTFS_MKFS_OPTS_BLOCKSIZE_BITMASK;
- return do_mkfs_opts (fstype, device, blocksize);
+ return do_mkfs_opts (fstype, device, blocksize, 0);
}
See also C<guestfs_is_lv>.");
- ("mkfs_opts", (RErr, [String "fstype"; Device "device"], [Int "blocksize"]), 278, [],
+ ("mkfs_opts", (RErr, [String "fstype"; Device "device"], [Int "blocksize"; String "features"]), 278, [],
[InitEmpty, Always, TestOutput (
[["part_disk"; "/dev/sda"; "mbr"];
- ["mkfs_opts"; "ext2"; "/dev/sda1"; "4096"];
+ ["mkfs_opts"; "ext2"; "/dev/sda1"; "4096"; ""];
["mount_options"; ""; "/dev/sda1"; "/"];
["write"; "/new"; "new file contents"];
["cat"; "/new"]], "new file contents")],
For UFS block sizes, please see L<mkfs.ufs(8)>.
+=item C<features>
+
+This passes the C<-O> parameter to the external mkfs program.
+
+For certain filesystem types, this allows extra filesystem
+features to be selected. See L<mke2fs(8)> and L<mkfs.ufs(8)>
+for more details.
+
+You cannot use this optional parameter with the C<gfs> or
+C<gfs2> filesystem type.
+
=back");
("getxattr", (RBufferOut "xattr", [Pathname "path"; String "name"], []), 279, [Optional "linuxxattrs"],