qemu/tests/qemu-iotests
Hanna Reitz 9ffd6d646d iotests/108: Test new refcount rebuild algorithm
One clear problem with how qcow2's refcount structure rebuild algorithm
used to be before "qcow2: Improve refcount structure rebuilding" was
that it is prone to failure for qcow2 images on block devices: There is
generally unused space after the actual image, and if that exceeds what
one refblock covers, the old algorithm would invariably write the
reftable past the block device's end, which cannot work.  The new
algorithm does not have this problem.

Test it with three tests:
(1) Create an image with more empty space at the end than what one
    refblock covers, see whether rebuilding the refcount structures
    results in a change in the image file length.  (It should not.)

(2) Leave precisely enough space somewhere at the beginning of the image
    for the new reftable (and the refblock for that place), see whether
    the new algorithm puts the reftable there.  (It should.)

(3) Test the original problem: Create (something like) a block device
    with a fixed size, then create a qcow2 image in there, write some
    data, and then have qemu-img check rebuild the refcount structures.
    Before HEAD^, the reftable would have been written past the image
    file end, i.e. outside of what the block device provides, which
    cannot work.  HEAD^ should have fixed that.
    ("Something like a block device" means a loop device if we can use
    one ("sudo -n losetup" works), or a FUSE block export with
    growable=false otherwise.)

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20220405134652.19278-3-hreitz@redhat.com>
2022-04-20 12:09:17 +02:00
..
001
002
003
004
005
007
008
009
010
011
012
013
014
015
017
018
019
020
021
022
023
024
026
029
030
2022-03-29 16:30:55 +02:00
032
033
034
035
037
038
041
2022-03-29 16:30:55 +02:00
042
043
044
2022-02-01 10:51:39 +01:00
045
046
047
048
049
050
2021-10-15 16:06:23 +02:00
052
053
054
055
056
057
058
063
065
2022-04-20 10:14:05 +02:00
073
075
076
077
078
079
080
081
082
083
086
087
088
092
093
096
101
104
109
114
116
118
124
128
130
131
132
133
134
136
137
2022-02-01 10:51:39 +01:00
139
2021-12-28 15:18:59 +01:00
145
147
148
149
2022-03-22 10:14:37 +01:00
151
152
154
155
157
158
159
160
161
170
171
172
174
175
177
178
179
181
183
184
185
2022-03-04 18:14:40 +01:00
2022-03-04 18:14:40 +01:00
186
187
188
189
190
191
195
197
198
201
204
205
206
2021-11-23 15:39:12 +01:00
207
2022-03-22 10:50:10 +01:00
2022-03-22 10:50:10 +01:00
208
209
2022-02-01 10:51:39 +01:00
2021-11-23 15:39:12 +01:00
211
2022-03-22 10:14:34 +01:00
2022-03-22 10:14:34 +01:00
212
213
214
2022-02-01 10:51:39 +01:00
215
217
219
220
221
223
226
227
232
235
236
238
239
240
243
244
247
248
249
253
256
263
264
265
267
268
270
272
273
2022-01-14 12:03:16 +01:00
277
279
282
283
2021-12-28 15:18:59 +01:00
2021-12-28 15:18:59 +01:00
284
286
288
289
292
293
294
295
297
2021-11-01 11:54:59 -04:00
298
299
301
302
2022-02-01 10:51:39 +01:00
2022-02-01 10:51:39 +01:00
303
2022-04-20 10:14:08 +02:00
2022-02-01 10:51:39 +01:00
304
305
307
308
2022-01-14 12:03:16 +01:00
2022-01-14 12:03:16 +01:00
312
313

=== 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.