qemu/tests/qemu-iotests
Max Reitz aad15de427 qemu-img: Fix preallocation with -S 0 for convert
When passing -S 0 to qemu-img convert, the target image is supposed to
be fully allocated. Right now, this is not the case if the source image
contains areas which bdrv_get_block_status() reports as being zero.

This patch changes a zeroed area's status from BLK_ZERO to BLK_DATA
before invoking convert_write() if -S 0 has been specified. In addition,
the check whether convert_read() actually needs to do anything
(basically only if the current area is a BLK_DATA area) is pulled out of
that function to the caller.

If -S 0 has been specified, zeroed areas need to be written as data to
the output, thus they then have to be accounted when calculating the
progress made.

This patch changes the reference output for iotest 122; contrary to what
it assumed, -S 0 really should allocate everything in the output, not
just areas that are filled with zeros (as opposed to being zeroed).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-03-30 12:16:03 +02: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
2016-01-20 13:36:23 +01:00
029
030
2016-03-28 13:56:44 -04:00
2016-03-28 13:56:44 -04:00
031
032
033
034
035
036
2016-01-20 13:36:23 +01:00
037
038
039
040
041
042
043
044
045
046
047
048
049
050
051
2016-03-30 12:16:03 +02:00
2016-03-30 12:16:03 +02:00
052
053
054
055
056
057
058
060
061
062
063
064
065
066
067
2016-02-22 16:54:14 +01:00
2016-02-22 16:54:14 +01:00
068
069
070
071
072
073
074
075
076
077
078
079
080
081
082
084
085
086
088
089
090
091
092
094
095
096
097
098
099
100
101
102
103
104
105
107
108
109
2016-02-29 14:54:31 -05:00
110
111
112
113
114
115
116
118
2016-02-02 17:49:42 +01:00
119
120
121
122
123
128
129
130
131
132
133
134
135
136
137
138
139
142
2016-03-30 12:16:03 +02:00
2016-03-30 12:16:03 +02:00
145
2016-02-22 09:49:46 +01:00
2016-02-22 09:49:46 +01:00
2016-02-16 14:29:27 +00: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@savannah.nongnu.org.