From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
qemu-devel@nongnu.org, "Maxim Levitsky" <mlevitsk@redhat.com>,
"Max Reitz" <mreitz@redhat.com>
Subject: [Qemu-devel] [PATCH] doc: Preallocation does not require writing zeroes
Date: Thu, 11 Jul 2019 15:29:35 +0200 [thread overview]
Message-ID: <20190711132935.13070-1-mreitz@redhat.com> (raw)
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 <mreitz@redhat.com>
---
qapi/block-core.json | 9 +++++----
docs/qemu-block-drivers.texi | 4 ++--
qemu-img.texi | 4 ++--
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 0d43d4f37c..a4363b84d2 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -5167,10 +5167,11 @@
# @off: no preallocation
# @metadata: preallocate only for metadata
# @falloc: like @full preallocation but allocate disk space by
-# posix_fallocate() rather than writing zeros.
-# @full: preallocate all data by writing zeros to device to ensure disk
-# space is really available. @full preallocation also sets up
-# metadata correctly.
+# posix_fallocate() rather than writing data.
+# @full: preallocate all data by writing it to the device to ensure
+# disk space is really available. This data may or may not be
+# zero, depending on the image format and storage.
+# @full preallocation also sets up metadata correctly.
#
# Since: 2.2
##
diff --git a/docs/qemu-block-drivers.texi b/docs/qemu-block-drivers.texi
index 91ab0eceae..c02547e28c 100644
--- a/docs/qemu-block-drivers.texi
+++ b/docs/qemu-block-drivers.texi
@@ -31,8 +31,8 @@ Supported options:
@item preallocation
Preallocation mode (allowed values: @code{off}, @code{falloc}, @code{full}).
@code{falloc} mode preallocates space for image by calling posix_fallocate().
-@code{full} mode preallocates space for image by writing zeros to underlying
-storage.
+@code{full} mode preallocates space for image by writing data to underlying
+storage. This data may or may not be zero, depending on the storage location.
@end table
@item qcow2
diff --git a/qemu-img.texi b/qemu-img.texi
index c8e9bba515..b5156d6316 100644
--- a/qemu-img.texi
+++ b/qemu-img.texi
@@ -666,8 +666,8 @@ Supported options:
@item preallocation
Preallocation mode (allowed values: @code{off}, @code{falloc}, @code{full}).
@code{falloc} mode preallocates space for image by calling posix_fallocate().
-@code{full} mode preallocates space for image by writing zeros to underlying
-storage.
+@code{full} mode preallocates space for image by writing data to underlying
+storage. This data may or may not be zero, depending on the storage location.
@end table
@item qcow2
--
2.21.0
next reply other threads:[~2019-07-11 13:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-11 13:29 Max Reitz [this message]
2019-07-11 13:34 ` [Qemu-devel] [PATCH] doc: Preallocation does not require writing zeroes Eric Blake
2019-07-11 13:42 ` Daniel P. Berrangé
2019-07-11 14:04 ` Maxim Levitsky
2019-07-12 10:27 ` [Qemu-devel] [Qemu-block] " Stefano Garzarella
2019-07-12 18:33 ` Max Reitz
2019-07-15 8:01 ` Stefano Garzarella
2019-08-15 16:10 ` [Qemu-devel] " Max Reitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190711132935.13070-1-mreitz@redhat.com \
--to=mreitz@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=kwolf@redhat.com \
--cc=mlevitsk@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).