qemu-e2k/tests/qemu-iotests
Alberto Garcia 80f5c01183 qcow2: Forbid discard in qcow2 v2 images with backing files
A discard request deallocates the selected clusters so they read back
as zeroes. This is done by clearing the cluster offset field and
setting QCOW_OFLAG_ZERO in the L2 entry.

This flag is however only supported when qcow_version >= 3. In older
images the cluster is simply deallocated, exposing any possible stale
data from the backing file.

Since discard is an advisory operation it's safer to simply forbid it
in this scenario.

Note that we are adding this check to qcow2_co_pdiscard() and not to
qcow2_cluster_discard() or discard_in_l2_slice() because the last
two are also used by qcow2_snapshot_create() to discard the clusters
used by the VM state. In this case there's no risk of exposing stale
data to the guest and we really want that the clusters are always
discarded.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Message-Id: <20200331114345.29993-1-berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
2020-04-07 13:51:09 +02:00
..
001
002
003
004
008
009
010
011
012
013
017
018
021
022
023
025
027
032
033
034
035
037
038
042
047
2019-11-19 10:01:34 +01:00
052
054
063
2020-01-06 13:43:07 +01:00
2020-01-06 13:43:07 +01:00
064
070
072
075
076
077
078
079
2020-01-06 13:43:07 +01:00
082
083
2019-10-28 11:22:31 +01:00
084
085
2020-03-24 11:57:38 +01:00
086
087
2020-03-24 11:57:38 +01:00
2020-01-06 13:43:07 +01:00
097
101
102
104
105
106
2020-01-06 13:43:07 +01:00
107
110
2020-01-06 13:43:07 +01:00
2020-01-06 13:43:07 +01:00
111
2020-01-06 13:43:07 +01:00
113
115
2020-01-06 13:43:07 +01:00
116
117
119
120
125
2020-01-06 13:43:07 +01:00
126
128
130
131
133
134
135
137
2020-01-06 13:43:07 +01:00
2020-01-06 13:43:07 +01:00
140
2019-10-28 11:22:31 +01:00
143
2019-10-28 11:22:31 +01:00
145
146
147
2020-02-20 16:43:42 +01:00
150
154
155
2020-03-11 15:54:38 +01:00
2020-03-11 15:54:38 +01:00
157
158
162
171
174
2020-01-06 13:43:07 +01:00
175
2020-01-06 13:43:07 +01:00
179
184
186
188
189
192
2019-10-28 11:22:31 +01:00
198
2020-01-06 13:43:07 +01:00
2020-01-06 13:43:07 +01:00
204
221
222
2020-02-07 15:15:16 +01:00
226
227
231
233
239
240
2019-10-28 11:22:31 +01:00
251
253
263
2019-10-22 20:51:31 -05:00
265
2020-01-06 13:43:07 +01:00
268
270
2019-11-18 16:01:31 -06:00
279
2020-03-24 11:57:38 +01:00
286
2020-02-20 16:43:42 +01:00

=== This is the QEMU I/O test suite ===

* Intro

This package contains a simple test suite for the I/O layer of qemu.
It does not require a guest, but only the qemu, qemu-img and qemu-io
binaries.  This does limit it to exercise the low-level I/O path only
but no actual block drivers like ide, scsi or virtio.

* Usage

Just run ./check to run all tests for the raw image format, or ./check
-qcow2 to test the qcow2 image format.  The output of ./check -h explains
additional options to test further image formats or I/O methods.

* Feedback and patches

Please send improvements to the test suite, general feedback or just
reports of failing tests cases to qemu-devel@nongnu.org with a CC:
to qemu-block@nongnu.org.