diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-07-31 08:57:10 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-07-31 10:22:38 +0100 |
commit | 0e6e32025885286e2de39efca34ced2aaf26b3a3 (patch) | |
tree | e4c3c747a1d2c805cd01c1e0a9c526407b520641 /src | |
parent | afaff775c12f32b7912f194e2fcc8e76b8c82572 (diff) | |
download | libguestfs-0e6e32025885286e2de39efca34ced2aaf26b3a3.tar.gz libguestfs-0e6e32025885286e2de39efca34ced2aaf26b3a3.tar.xz libguestfs-0e6e32025885286e2de39efca34ced2aaf26b3a3.zip |
New command: 'fallocate' to (pre-)allocate sized files.
Diffstat (limited to 'src')
-rw-r--r-- | src/MAX_PROC_NR | 2 | ||||
-rwxr-xr-x | src/generator.ml | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR index de8febe1..fb402ef6 100644 --- a/src/MAX_PROC_NR +++ b/src/MAX_PROC_NR @@ -1 +1 @@ -168 +169 diff --git a/src/generator.ml b/src/generator.ml index 34721938..e30f5ebf 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -3187,6 +3187,20 @@ The C<-f> option removes the link (C<linkname>) if it exists already."); "\ This command reads the target of a symbolic link."); + ("fallocate", (RErr, [String "path"; Int "len"]), 169, [], + [InitBasicFS, Always, TestOutputStruct ( + [["fallocate"; "/a"; "1000000"]; + ["stat"; "/a"]], [CompareWithInt ("size", 1_000_000)])], + "preallocate a file in the guest filesystem", + "\ +This command preallocates a file (containing zero bytes) named +C<path> of size C<len> bytes. If the file exists already, it +is overwritten. + +Do not confuse this with the guestfish-specific +C<alloc> command which allocates a file in the host and +attaches it as a device."); + ] let all_functions = non_daemon_functions @ daemon_functions |