Skip to content

Commit fa27c47

Browse files
committed
doc: Preallocation does not require writing zeroes
When preallocating an encrypted qcow2 image, it just lets the protocol driver write data and then does not mark the clusters as zero. Therefore, reading this image will yield effectively random data. As such, we have not fulfilled the promise of always writing zeroes when preallocating an image in a while. It seems that nobody has really cared, so change the documentation to conform to qemu's actual behavior. Signed-off-by: Max Reitz <[email protected]> Message-id: [email protected] Reviewed-by: Eric Blake <[email protected]> Reviewed-by: Daniel P. Berrangé <[email protected]> Reviewed-by: Maxim Levitsky <[email protected]> Signed-off-by: Max Reitz <[email protected]>
1 parent 9c46f4a commit fa27c47

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

docs/qemu-block-drivers.texi

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Supported options:
3131
@item preallocation
3232
Preallocation mode (allowed values: @code{off}, @code{falloc}, @code{full}).
3333
@code{falloc} mode preallocates space for image by calling posix_fallocate().
34-
@code{full} mode preallocates space for image by writing zeros to underlying
35-
storage.
34+
@code{full} mode preallocates space for image by writing data to underlying
35+
storage. This data may or may not be zero, depending on the storage location.
3636
@end table
3737

3838
@item qcow2

qapi/block-core.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -5178,10 +5178,11 @@
51785178
# @off: no preallocation
51795179
# @metadata: preallocate only for metadata
51805180
# @falloc: like @full preallocation but allocate disk space by
5181-
# posix_fallocate() rather than writing zeros.
5182-
# @full: preallocate all data by writing zeros to device to ensure disk
5183-
# space is really available. @full preallocation also sets up
5184-
# metadata correctly.
5181+
# posix_fallocate() rather than writing data.
5182+
# @full: preallocate all data by writing it to the device to ensure
5183+
# disk space is really available. This data may or may not be
5184+
# zero, depending on the image format and storage.
5185+
# @full preallocation also sets up metadata correctly.
51855186
#
51865187
# Since: 2.2
51875188
##

qemu-img.texi

+2-2
Original file line numberDiff line numberDiff line change
@@ -666,8 +666,8 @@ Supported options:
666666
@item preallocation
667667
Preallocation mode (allowed values: @code{off}, @code{falloc}, @code{full}).
668668
@code{falloc} mode preallocates space for image by calling posix_fallocate().
669-
@code{full} mode preallocates space for image by writing zeros to underlying
670-
storage.
669+
@code{full} mode preallocates space for image by writing data to underlying
670+
storage. This data may or may not be zero, depending on the storage location.
671671
@end table
672672
673673
@item qcow2

0 commit comments

Comments
 (0)