qemu/tests/qemu-iotests
Eric Blake a3e1505dae qcow2: Don't strand clusters near 2G intervals during commit
The qcow2_make_empty() function is reached during 'qemu-img commit',
in order to clear out ALL clusters of an image.  However, if the
image cannot use the fast code path (true if the image is format
0.10, or if the image contains a snapshot), the cluster size is
larger than 512, and the image is larger than 2G in size, then our
choice of sector_step causes problems.  Since it is not cluster
aligned, but qcow2_discard_clusters() silently ignores an unaligned
head or tail, we are leaving clusters allocated.

Enhance the testsuite to expose the flaw, and patch the problem by
ensuring our step size is aligned.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-12-06 15:37:02 +01:00
..
001
002
003
004
005
007
008
009
010
011
012
013
014
015
017
018
019
020
021
022
023
024
025
026
027
028
029
031
032
033
034
035
036
037
038
039
040
042
043
044
045
046
047
048
049
050
051
2016-10-27 19:05:23 +02:00
2016-10-27 19:05:23 +02:00
052
053
054
055
2016-09-20 22:12:57 +02:00
056
058
059
060
061
062
063
064
065
066
068
069
070
072
073
074
075
076
077
078
079
080
082
083
084
086
088
089
090
091
092
094
095
096
098
099
101
102
103
104
105
107
108
2016-08-08 13:05:43 +02:00
110
111
112
113
114
115
116
119
120
121
122
123
128
129
130
131
132
133
134
135
136
137
138
140
142
143
144
145
146
148
149
150
152
154
156
157
159
2016-09-20 22:10:57 +02:00
2016-09-20 22:10:57 +02:00
160
2016-09-20 22:10:57 +02:00
2016-09-20 22:10:57 +02:00
170
2016-09-20 22:10:57 +02:00
2016-09-20 22:10:57 +02:00
172
2016-10-27 16:29:14 -04: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.