summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-06-12 14:20:34 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-06-12 14:33:57 +0100
commit7590924022066f49d0adc48dbd05a4e8c053a5a4 (patch)
tree7ad61226eac6d2e5cd58cfb3970e948199805b2d /generator
parent668a0cebdf736a632f23764a927a095446fef1ca (diff)
downloadlibguestfs-7590924022066f49d0adc48dbd05a4e8c053a5a4.tar.gz
libguestfs-7590924022066f49d0adc48dbd05a4e8c053a5a4.tar.xz
libguestfs-7590924022066f49d0adc48dbd05a4e8c053a5a4.zip
New API: fstrim - allow filesystem trim.
Diffstat (limited to 'generator')
-rw-r--r--generator/generator_actions.ml27
1 files changed, 25 insertions, 2 deletions
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index cfbce008..120278aa 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -6821,8 +6821,9 @@ The filesystem must be mounted read-write.
The filesystem contents are not affected, but any free space
in the filesystem is freed.
-In future (but not currently) these zeroed blocks will be
-\"sparsified\" - that is, given back to the host.");
+Free space is not \"trimmed\". You may want to call
+C<guestfs_fstrim> either as an alternative to this,
+or after calling this, depending on your requirements.");
("lvcreate_free", (RErr, [String "logvol"; String "volgroup"; Int "percent"], []), 312, [Optional "lvm2"],
[InitEmpty, Always, TestOutputList (
@@ -7259,6 +7260,28 @@ a later version of the filesystem, or having incompatible features.
See also C<guestfs_available>, L<guestfs(3)/AVAILABILITY>.");
+ ("fstrim", (RErr, [Pathname "mountpoint"], [OInt64 "offset"; OInt64 "length"; OInt64 "minimumfreeextent"]), 334, [Optional "fstrim"],
+ [],
+ "trim free space in a filesystem",
+ "\
+Trim the free space in the filesystem mounted on C<mountpoint>.
+The filesystem must be mounted read-write.
+
+The filesystem contents are not affected, but any free space
+in the filesystem is \"trimmed\", that is, given back to the host
+device, thus making disk images more sparse, allowing unused space
+in qcow2 files to be reused, etc.
+
+This operation requires support in libguestfs, the mounted
+filesystem, the host filesystem, qemu and the host kernel.
+If this support isn't present it may give an error or even
+appear to run but do nothing.
+
+See also C<guestfs_zero_free_space>. That is a slightly
+different operation that turns free space in the filesystem
+into zeroes. It is valid to call C<guestfs_fstrim> either
+instead of, or after calling C<guestfs_zero_free_space>.");
+
]
let all_functions = non_daemon_functions @ daemon_functions