summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-12-02 13:35:14 +0000
committerRichard W.M. Jones <rjones@redhat.com>2010-12-02 13:43:18 +0000
commit0710326ac5f1a06cf1dc3500617d04cf4cba5631 (patch)
tree6fd18ef4f7145eedecfd00a1a29fc48d8b7048a3 /generator
parent65f44b459070a1dbfba66c31e0be69588e49f4a8 (diff)
downloadlibguestfs-0710326ac5f1a06cf1dc3500617d04cf4cba5631.tar.gz
libguestfs-0710326ac5f1a06cf1dc3500617d04cf4cba5631.tar.xz
libguestfs-0710326ac5f1a06cf1dc3500617d04cf4cba5631.zip
New API: mkfs_opts, mkfs with optional arguments.
This is an extensible version of 'mkfs' which supports optional arguments. There is now no need for 'mkfs_b' since you should use 'mkfs_opts' with the optional 'blocksize' argument instead.
Diffstat (limited to 'generator')
-rw-r--r--generator/generator_actions.ml29
1 files changed, 28 insertions, 1 deletions
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index a405fd4a..5624dec1 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -4186,7 +4186,7 @@ This gets the SELinux security context of the daemon.
See the documentation about SELINUX in L<guestfs(3)>,
and C<guestfs_setcon>");
- ("mkfs_b", (RErr, [String "fstype"; Int "blocksize"; Device "device"], []), 187, [],
+ ("mkfs_b", (RErr, [String "fstype"; Int "blocksize"; Device "device"], []), 187, [DeprecatedBy "mkfs_opts"],
[InitEmpty, Always, TestOutput (
[["part_disk"; "/dev/sda"; "mbr"];
["mkfs_b"; "ext2"; "4096"; "/dev/sda1"];
@@ -5606,6 +5606,33 @@ not refer to a logical volume.
See also C<guestfs_is_lv>.");
+ ("mkfs_opts", (RErr, [String "fstype"; Device "device"], [Int "blocksize"]), 278, [],
+ [InitEmpty, Always, TestOutput (
+ [["part_disk"; "/dev/sda"; "mbr"];
+ ["mkfs_opts"; "ext2"; "/dev/sda1"; "4096"];
+ ["mount_options"; ""; "/dev/sda1"; "/"];
+ ["write"; "/new"; "new file contents"];
+ ["cat"; "/new"]], "new file contents")],
+ "make a filesystem",
+ "\
+This function creates a filesystem on C<device>. The filesystem
+type is C<fstype>, for example C<ext3>.
+
+The optional arguments are:
+
+=over 4
+
+=item C<blocksize>
+
+The filesystem block size. Supported block sizes depend on the
+filesystem type, but typically they are C<1024>, C<2048> or C<4096>
+for Linux ext2/3 filesystems.
+
+For VFAT and NTFS the C<blocksize> parameter is treated as
+the requested cluster size.
+
+=back");
+
]
let all_functions = non_daemon_functions @ daemon_functions