2009-06-22 18:29:05 +02:00
|
|
|
#
|
|
|
|
# QA groups control file
|
|
|
|
# Defines test groups
|
2019-05-02 10:45:05 +02:00
|
|
|
#
|
|
|
|
# Some notes about the groups:
|
|
|
|
#
|
2009-06-22 18:29:05 +02:00
|
|
|
# - do not start group names with a digit
|
|
|
|
#
|
2019-05-02 10:45:05 +02:00
|
|
|
# - quick : Tests in this group should finish within some few seconds.
|
|
|
|
#
|
|
|
|
# - img : Tests in this group can be used to excercise the qemu-img tool.
|
|
|
|
#
|
|
|
|
# - auto : Tests in this group are used during "make check" and should be
|
|
|
|
# runnable in any case. That means they should run with every QEMU binary
|
|
|
|
# (also non-x86), with every QEMU configuration (i.e. must not fail if
|
|
|
|
# an optional feature is not compiled in - but reporting a "skip" is ok),
|
2019-07-17 13:19:45 +02:00
|
|
|
# work at least with the qcow2 file format, work with all kind of host
|
|
|
|
# filesystems and users (e.g. "nobody" or "root") and must not take too
|
|
|
|
# much memory and disk space (since CI pipelines tend to fail otherwise).
|
2019-05-02 10:45:05 +02:00
|
|
|
#
|
2009-06-22 18:29:05 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# test-group association ... one line per test
|
|
|
|
#
|
2014-06-27 22:47:48 +02:00
|
|
|
001 rw auto quick
|
2012-03-08 12:26:52 +01:00
|
|
|
002 rw auto quick
|
2009-06-22 18:29:05 +02:00
|
|
|
003 rw auto
|
2012-03-08 12:26:52 +01:00
|
|
|
004 rw auto quick
|
2014-06-27 22:47:48 +02:00
|
|
|
005 img auto quick
|
2015-03-03 22:22:38 +01:00
|
|
|
# 006 was removed, do not reuse
|
2009-06-22 18:29:05 +02:00
|
|
|
007 snapshot auto
|
2014-06-27 22:47:48 +02:00
|
|
|
008 rw auto quick
|
|
|
|
009 rw auto quick
|
|
|
|
010 rw auto quick
|
2012-03-08 12:26:52 +01:00
|
|
|
011 rw auto quick
|
|
|
|
012 auto quick
|
2009-06-22 18:29:05 +02:00
|
|
|
013 rw auto
|
2019-07-17 13:19:45 +02:00
|
|
|
014 rw
|
|
|
|
015 rw snapshot
|
2015-02-05 19:58:21 +01:00
|
|
|
# 016 was removed, do not reuse
|
2012-03-08 12:26:52 +01:00
|
|
|
017 rw backing auto quick
|
2014-06-27 22:47:48 +02:00
|
|
|
018 rw backing auto quick
|
2012-03-08 12:26:52 +01:00
|
|
|
019 rw backing auto quick
|
|
|
|
020 rw backing auto quick
|
2014-06-27 22:47:48 +02:00
|
|
|
021 io auto quick
|
2009-07-20 14:36:47 +02:00
|
|
|
022 rw snapshot auto
|
2019-07-17 13:19:45 +02:00
|
|
|
023 rw
|
2012-03-08 12:26:52 +01:00
|
|
|
024 rw backing auto quick
|
|
|
|
025 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
026 rw blkdbg
|
2012-03-08 12:26:52 +01:00
|
|
|
027 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
028 rw backing quick
|
2012-03-08 12:26:52 +01:00
|
|
|
029 rw auto quick
|
2020-01-21 10:52:05 +01:00
|
|
|
030 rw auto backing
|
2012-02-16 16:55:01 +01:00
|
|
|
031 rw auto quick
|
2014-06-27 22:47:48 +02:00
|
|
|
032 rw auto quick
|
2013-11-22 13:39:58 +01:00
|
|
|
033 rw auto quick
|
2014-06-27 22:47:48 +02:00
|
|
|
034 rw auto backing quick
|
2012-04-24 16:30:23 +02:00
|
|
|
035 rw auto quick
|
2012-06-14 14:58:18 +02:00
|
|
|
036 rw auto quick
|
2014-06-27 22:47:48 +02:00
|
|
|
037 rw auto backing quick
|
|
|
|
038 rw auto backing quick
|
|
|
|
039 rw auto quick
|
2020-01-21 10:52:05 +01:00
|
|
|
040 rw auto
|
|
|
|
041 rw auto backing
|
2012-10-12 14:24:42 +02:00
|
|
|
042 rw auto quick
|
2012-10-17 14:02:32 +02:00
|
|
|
043 rw auto backing
|
2019-05-02 10:45:05 +02:00
|
|
|
044 rw
|
|
|
|
045 rw quick
|
2014-06-27 22:47:48 +02:00
|
|
|
046 rw auto aio quick
|
|
|
|
047 rw auto quick
|
2013-02-13 09:09:42 +01:00
|
|
|
048 img auto quick
|
2013-01-29 10:46:52 +01:00
|
|
|
049 rw auto
|
2013-03-13 15:58:13 +01:00
|
|
|
050 rw auto backing quick
|
2019-05-02 10:45:05 +02:00
|
|
|
051 rw
|
2014-02-20 18:28:03 +01:00
|
|
|
052 rw auto backing quick
|
|
|
|
053 rw auto quick
|
|
|
|
054 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
055 rw
|
|
|
|
056 rw backing
|
|
|
|
057 rw
|
|
|
|
058 rw quick
|
2019-07-17 13:19:45 +02:00
|
|
|
059 rw quick
|
2014-02-20 18:28:03 +01:00
|
|
|
060 rw auto quick
|
2014-10-27 11:12:56 +01:00
|
|
|
061 rw auto
|
2014-02-20 18:28:03 +01:00
|
|
|
062 rw auto quick
|
|
|
|
063 rw auto quick
|
2019-07-17 13:19:45 +02:00
|
|
|
064 rw quick
|
2019-05-02 10:45:05 +02:00
|
|
|
065 rw quick
|
2014-02-20 18:28:03 +01:00
|
|
|
066 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
067 rw quick
|
|
|
|
068 rw quick
|
2014-02-20 18:28:03 +01:00
|
|
|
069 rw auto quick
|
2019-07-17 13:19:45 +02:00
|
|
|
070 rw quick
|
2014-06-27 22:47:47 +02:00
|
|
|
071 rw auto quick
|
2014-02-20 18:28:03 +01:00
|
|
|
072 rw auto quick
|
|
|
|
073 rw auto quick
|
|
|
|
074 rw auto quick
|
2019-07-17 13:19:45 +02:00
|
|
|
075 rw quick
|
|
|
|
076 io
|
|
|
|
077 rw quick
|
|
|
|
078 rw quick
|
2014-01-26 04:12:40 +01:00
|
|
|
079 rw auto
|
2014-03-26 13:05:41 +01:00
|
|
|
080 rw auto
|
2019-07-17 13:19:45 +02:00
|
|
|
081 rw quick
|
|
|
|
082 rw quick
|
|
|
|
083 rw
|
|
|
|
084 img quick
|
2019-05-02 10:45:05 +02:00
|
|
|
085 rw
|
2014-03-03 14:53:04 +01:00
|
|
|
086 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
087 rw quick
|
2019-07-17 13:19:45 +02:00
|
|
|
088 rw quick
|
2014-05-08 20:12:42 +02:00
|
|
|
089 rw auto quick
|
2014-04-29 16:12:31 +02:00
|
|
|
090 rw auto quick
|
2019-07-17 13:19:45 +02:00
|
|
|
091 rw migration
|
|
|
|
092 rw quick
|
2019-05-02 10:45:05 +02:00
|
|
|
093 throttle
|
2019-07-17 13:19:45 +02:00
|
|
|
094 rw quick
|
2019-05-02 10:45:05 +02:00
|
|
|
095 rw quick
|
|
|
|
096 rw quick
|
2014-10-24 15:57:42 +02:00
|
|
|
097 rw auto backing
|
2014-10-24 15:57:43 +02:00
|
|
|
098 rw auto backing quick
|
2014-07-18 20:25:01 +02:00
|
|
|
099 rw auto quick
|
2016-02-26 13:50:43 +01:00
|
|
|
# 100 was removed, do not reuse
|
2019-07-17 13:19:45 +02:00
|
|
|
101 rw quick
|
|
|
|
102 rw quick
|
2014-08-18 22:07:34 +02:00
|
|
|
103 rw auto quick
|
2014-09-10 11:05:45 +02:00
|
|
|
104 rw auto
|
2014-09-23 03:56:21 +02:00
|
|
|
105 rw auto quick
|
2019-07-17 13:19:45 +02:00
|
|
|
106 rw quick
|
2014-10-16 15:25:57 +02:00
|
|
|
107 rw auto quick
|
2014-10-22 14:09:43 +02:00
|
|
|
108 rw auto quick
|
2019-07-17 13:19:45 +02:00
|
|
|
109 rw
|
2014-11-26 17:20:29 +01:00
|
|
|
110 rw auto backing quick
|
2014-10-27 13:30:09 +01:00
|
|
|
111 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
112 rw
|
2019-07-17 13:19:45 +02:00
|
|
|
113 rw quick
|
2014-11-25 18:12:42 +01:00
|
|
|
114 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
115 rw
|
2019-07-17 13:19:45 +02:00
|
|
|
116 rw quick
|
2016-01-29 16:36:15 +01:00
|
|
|
117 rw auto
|
2019-05-02 10:45:05 +02:00
|
|
|
118 rw
|
2019-07-17 13:19:45 +02:00
|
|
|
119 rw quick
|
2015-03-19 19:53:17 +01:00
|
|
|
120 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
121 rw
|
2019-07-17 13:19:45 +02:00
|
|
|
122 rw
|
|
|
|
123 rw quick
|
2019-05-02 10:45:05 +02:00
|
|
|
124 rw backing
|
|
|
|
125 rw
|
2017-07-02 17:05:10 +02:00
|
|
|
126 rw auto backing
|
2020-01-21 10:52:05 +01:00
|
|
|
127 rw auto backing quick
|
2019-07-17 13:19:45 +02:00
|
|
|
128 rw quick
|
2019-05-02 10:45:05 +02:00
|
|
|
129 rw quick
|
2019-10-18 18:10:08 +02:00
|
|
|
130 rw quick
|
2019-07-17 13:19:45 +02:00
|
|
|
131 rw quick
|
2019-05-02 10:45:05 +02:00
|
|
|
132 rw quick
|
2015-05-08 18:11:08 +02:00
|
|
|
133 auto quick
|
2015-05-12 18:09:22 +02:00
|
|
|
134 rw auto quick
|
2019-07-17 13:19:45 +02:00
|
|
|
135 rw
|
2019-05-02 10:45:05 +02:00
|
|
|
136 rw
|
2015-09-04 19:13:14 +02:00
|
|
|
137 rw auto
|
2015-09-09 18:09:47 +02:00
|
|
|
138 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
139 rw quick
|
2016-01-29 16:36:02 +01:00
|
|
|
140 rw auto quick
|
2016-01-29 16:36:16 +01:00
|
|
|
141 rw auto quick
|
2019-07-17 13:19:45 +02:00
|
|
|
142
|
2016-01-25 19:41:15 +01:00
|
|
|
143 auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
144 rw quick
|
|
|
|
145 quick
|
2019-07-17 13:19:45 +02:00
|
|
|
146 quick
|
2019-05-02 10:45:05 +02:00
|
|
|
147 img
|
|
|
|
148 rw quick
|
|
|
|
149 rw sudo
|
2016-03-24 23:34:00 +01:00
|
|
|
150 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
151 rw
|
|
|
|
152 rw quick
|
|
|
|
153 rw quick
|
2016-05-17 18:37:39 +02:00
|
|
|
154 rw auto backing quick
|
2019-05-02 10:45:05 +02:00
|
|
|
155 rw
|
2016-06-10 20:57:50 +02:00
|
|
|
156 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
157 quick
|
2016-09-06 16:26:37 +02:00
|
|
|
158 rw auto quick
|
2016-08-10 04:43:12 +02:00
|
|
|
159 rw auto quick
|
2019-07-17 13:19:45 +02:00
|
|
|
160 rw quick
|
block: Update BlockDriverState.inherits_from on bdrv_set_backing_hd()
When a BlockDriverState's child is opened (be it a backing file, the
protocol layer, or any other) inherits_from is set to point to the
parent node. Children opened separately and then attached to a parent
don't have this pointer set.
bdrv_reopen_queue_child() uses this to determine whether a node's
children must also be reopened inheriting the options from the parent
or not. If inherits_from points to the parent then the child is
reopened and its options can be changed, like in this example:
$ qemu-img create -f qcow2 hd0.qcow2 1M
$ qemu-img create -f qcow2 hd1.qcow2 1M
$ $QEMU -drive if=none,node-name=hd0,file=hd0.qcow2,\
backing.driver=qcow2,backing.file.filename=hd1.qcow2
(qemu) qemu-io hd0 "reopen -o backing.l2-cache-size=2M"
If the child does not inherit from the parent then it does not get
reopened and its options cannot be changed:
$ $QEMU -drive if=none,node-name=hd1,file=hd1.qcow2
-drive if=none,node-name=hd0,file=hd0.qcow2,backing=hd1
(qemu) qemu-io hd0 "reopen -o backing.l2-cache-size=2M"
Cannot change the option 'backing.l2-cache-size'
If a disk image has a chain of backing files then all of them are also
connected through their inherits_from pointers (i.e. it's possible to
walk the chain in reverse order from base to top).
However this is broken if the intermediate nodes are removed using
e.g. block-stream because the inherits_from pointer from the base node
becomes NULL:
$ qemu-img create -f qcow2 hd0.qcow2 1M
$ qemu-img create -f qcow2 -b hd0.qcow2 hd1.qcow2
$ qemu-img create -f qcow2 -b hd1.qcow2 hd2.qcow2
$ $QEMU -drive if=none,file=hd2.qcow2
(qemu) qemu-io none0 "reopen -o backing.l2-cache-size=2M"
(qemu) block_stream none0 0 hd0.qcow2
(qemu) qemu-io none0 "reopen -o backing.l2-cache-size=2M"
Cannot change the option 'backing.l2-cache-size'
This patch updates the inherits_from pointer if the intermediate nodes
of a backing chain are removed using bdrv_set_backing_hd(), and adds a
test case for this scenario.
Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-10-31 17:16:37 +01:00
|
|
|
161 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
162 quick
|
|
|
|
163 rw
|
|
|
|
165 rw quick
|
|
|
|
169 rw quick migration
|
2016-08-10 04:43:12 +02:00
|
|
|
170 rw auto quick
|
2019-07-17 13:19:45 +02:00
|
|
|
171 rw quick
|
2016-10-27 22:29:14 +02:00
|
|
|
172 auto
|
2019-07-17 13:19:45 +02:00
|
|
|
173 rw
|
2017-02-01 01:31:20 +01:00
|
|
|
174 auto
|
2019-07-17 13:19:45 +02:00
|
|
|
175 quick
|
2017-03-31 20:53:54 +02:00
|
|
|
176 rw auto backing
|
tests: Add coverage for recent block geometry fixes
Use blkdebug's new geometry constraints to emulate setups that
have needed past regression fixes: write zeroes asserting
when running through a loopback block device with max-transfer
smaller than cluster size, and discard rounding away portions
of requests not aligned to preferred boundaries. Also, add
coverage that the block layer is honoring max transfer limits.
For now, a single iotest performs all actions, with the idea
that we can add future blkdebug constraint test cases in the
same file; but it can be split into multiple iotests if we find
reason to run one portion of the test in more setups than what
are possible in the other.
For reference, the final portion of the test (checking whether
discard passes as much as possible to the lowest layers of the
stack) works as follows:
qemu-io: discard 30M at 80000001, passed to blkdebug
blkdebug: discard 511 bytes at 80000001, -ENOTSUP (smaller than
blkdebug's 512 align)
blkdebug: discard 14371328 bytes at 80000512, passed to qcow2
qcow2: discard 739840 bytes at 80000512, -ENOTSUP (smaller than
qcow2's 1M align)
qcow2: discard 13M bytes at 77M, succeeds
blkdebug: discard 15M bytes at 90M, passed to qcow2
qcow2: discard 15M bytes at 90M, succeeds
blkdebug: discard 1356800 bytes at 105M, passed to qcow2
qcow2: discard 1M at 105M, succeeds
qcow2: discard 308224 bytes at 106M, -ENOTSUP (smaller than qcow2's
1M align)
blkdebug: discard 1 byte at 111457280, -ENOTSUP (smaller than
blkdebug's 512 align)
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: 20170429191419.30051-10-eblake@redhat.com
[mreitz: For cooperation with image locking, add -r to the qemu-io
invocation which verifies the image content]
Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-04-29 21:14:19 +02:00
|
|
|
177 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
178 img
|
2017-05-07 02:05:49 +02:00
|
|
|
179 rw auto quick
|
2020-01-21 10:52:05 +01:00
|
|
|
181 rw auto migration
|
2019-05-02 10:45:05 +02:00
|
|
|
182 rw quick
|
|
|
|
183 rw migration
|
2017-08-25 15:20:28 +02:00
|
|
|
184 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
185 rw
|
2017-07-12 13:36:06 +02:00
|
|
|
186 rw auto
|
2017-08-03 17:03:01 +02:00
|
|
|
187 rw auto
|
2019-05-02 10:45:05 +02:00
|
|
|
188 rw quick
|
|
|
|
189 rw
|
2017-07-24 17:39:52 +02:00
|
|
|
190 rw auto quick
|
2017-06-29 19:56:48 +02:00
|
|
|
191 rw auto
|
2017-08-15 15:07:40 +02:00
|
|
|
192 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
194 rw migration quick
|
2017-09-15 18:56:41 +02:00
|
|
|
195 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
196 rw quick migration
|
2019-07-17 13:19:45 +02:00
|
|
|
197 rw quick
|
2019-05-02 10:45:05 +02:00
|
|
|
198 rw
|
|
|
|
199 rw migration
|
|
|
|
200 rw
|
2019-07-17 13:19:45 +02:00
|
|
|
201 rw migration
|
2019-05-02 10:45:05 +02:00
|
|
|
202 rw quick
|
2020-01-21 10:52:05 +01:00
|
|
|
203 rw auto migration
|
2019-05-02 10:45:05 +02:00
|
|
|
204 rw quick
|
|
|
|
205 rw quick
|
|
|
|
206 rw
|
2019-07-17 13:19:45 +02:00
|
|
|
207 rw
|
2019-05-02 10:45:05 +02:00
|
|
|
208 rw quick
|
|
|
|
209 rw quick
|
2019-07-17 13:19:45 +02:00
|
|
|
210 rw
|
|
|
|
211 rw quick
|
|
|
|
212 rw quick
|
|
|
|
213 rw quick
|
2018-04-06 18:41:08 +02:00
|
|
|
214 rw auto
|
2019-07-17 13:19:45 +02:00
|
|
|
215 rw quick
|
2019-05-02 10:45:05 +02:00
|
|
|
216 rw quick
|
2018-05-09 22:00:59 +02:00
|
|
|
217 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
218 rw quick
|
|
|
|
219 rw
|
2018-11-14 00:03:19 +01:00
|
|
|
220 rw auto
|
2019-07-17 13:19:45 +02:00
|
|
|
221 rw quick
|
2019-05-02 10:45:05 +02:00
|
|
|
222 rw quick
|
|
|
|
223 rw quick
|
|
|
|
224 rw quick
|
2019-07-17 13:19:45 +02:00
|
|
|
225 rw quick
|
2018-07-10 19:00:41 +02:00
|
|
|
226 auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
227 quick
|
|
|
|
228 rw quick
|
2018-08-21 18:26:20 +02:00
|
|
|
229 auto quick
|
2019-07-17 13:19:45 +02:00
|
|
|
231 quick
|
2019-05-02 10:45:05 +02:00
|
|
|
232 quick
|
2019-07-17 13:19:45 +02:00
|
|
|
233 quick
|
2019-05-02 10:45:05 +02:00
|
|
|
234 quick migration
|
|
|
|
235 quick
|
|
|
|
236 quick
|
2019-07-17 13:19:45 +02:00
|
|
|
237 rw quick
|
2019-05-02 10:45:05 +02:00
|
|
|
238 quick
|
2019-07-17 13:19:45 +02:00
|
|
|
239 rw quick
|
2019-05-02 10:45:05 +02:00
|
|
|
240 quick
|
2019-07-17 13:19:45 +02:00
|
|
|
241 rw quick
|
2019-05-02 10:45:05 +02:00
|
|
|
242 rw quick
|
2019-07-17 13:19:45 +02:00
|
|
|
243 rw quick
|
2019-02-22 11:45:50 +01:00
|
|
|
244 rw auto quick
|
2019-05-02 10:45:05 +02:00
|
|
|
245 rw
|
|
|
|
246 rw quick
|
|
|
|
247 rw quick
|
|
|
|
248 rw quick
|
2019-04-29 15:51:09 +02:00
|
|
|
249 rw auto quick
|
2019-07-17 13:19:45 +02:00
|
|
|
250 rw quick
|
2019-05-07 22:35:07 +02:00
|
|
|
251 rw auto quick
|
2019-05-09 19:52:37 +02:00
|
|
|
252 rw auto backing quick
|
2019-07-17 13:19:45 +02:00
|
|
|
253 rw quick
|
|
|
|
254 rw backing quick
|
|
|
|
255 rw quick
|
2020-01-21 10:52:05 +01:00
|
|
|
256 rw auto quick
|
2019-07-29 22:35:54 +02:00
|
|
|
257 rw
|
2019-07-22 15:33:47 +02:00
|
|
|
258 rw quick
|
2020-01-22 17:45:32 +01:00
|
|
|
259 rw auto quick
|
2019-09-27 14:23:53 +02:00
|
|
|
260 rw quick
|
2019-10-11 17:28:14 +02:00
|
|
|
261 rw
|
2019-08-01 17:12:25 +02:00
|
|
|
262 rw quick migration
|
2019-09-15 22:36:55 +02:00
|
|
|
263 rw quick
|
2019-10-09 10:41:58 +02:00
|
|
|
264 rw
|
2019-08-23 15:03:41 +02:00
|
|
|
265 rw auto quick
|
2019-09-02 21:33:20 +02:00
|
|
|
266 rw quick
|
2019-09-17 12:43:42 +02:00
|
|
|
267 rw auto quick snapshot
|
2019-10-14 10:15:45 +02:00
|
|
|
268 rw auto quick
|
iotests: Test large write request to qcow2 file
Without HEAD^, the following happens when you attempt a large write
request to a qcow2 file such that the number of bytes covered by all
clusters involved in a single allocation will exceed INT_MAX:
(A) handle_alloc_space() decides to fill the whole area with zeroes and
fails because bdrv_co_pwrite_zeroes() fails (the request is too
large).
(B) If handle_alloc_space() does not do anything, but merge_cow()
decides that the requests can be merged, it will create a too long
IOV that later cannot be written.
(C) Otherwise, all parts will be written separately, so those requests
will work.
In either B or C, though, qcow2_alloc_cluster_link_l2() will have an
overflow: We use an int (i) to iterate over nb_clusters, and then
calculate the L2 entry based on "i << s->cluster_bits" -- which will
overflow if the range covers more than INT_MAX bytes. This then leads
to image corruption because the L2 entry will be wrong (it will be
recognized as a compressed cluster).
Even if that were not the case, the .cow_end area would be empty
(because handle_alloc() will cap avail_bytes and nb_bytes at INT_MAX, so
their difference (which is the .cow_end size) will be 0).
So this test checks that on such large requests, the image will not be
corrupted. Unfortunately, we cannot check whether COW will be handled
correctly, because that data is discarded when it is written to null-co
(but we have to use null-co, because writing 2 GB of data in a test is
not quite reasonable).
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2019-10-10 12:08:58 +02:00
|
|
|
270 rw backing quick
|
2019-10-28 17:18:41 +01:00
|
|
|
272 rw
|
2019-11-08 09:46:03 +01:00
|
|
|
273 backing quick
|
2019-11-12 04:39:36 +01:00
|
|
|
277 rw quick
|
2019-12-05 14:46:46 +01:00
|
|
|
279 rw backing quick
|
2019-12-17 15:18:58 +01:00
|
|
|
280 rw migration quick
|
2020-01-08 15:31:38 +01:00
|
|
|
281 rw quick
|
2020-01-30 22:39:07 +01:00
|
|
|
282 rw img quick
|
2020-01-21 15:28:02 +01:00
|
|
|
283 auto quick
|
block: always fill entire LUKS header space with zeros
When initializing the LUKS header the size with default encryption
parameters will currently be 2068480 bytes. This is rounded up to
a multiple of the cluster size, 2081792, with 64k sectors. If the
end of the header is not the same as the end of the cluster we fill
the extra space with zeros. This was forgetting that not even the
space allocated for the header will be fully initialized, as we
only write key material for the first key slot. The space left
for the other 7 slots is never written to.
An optimization to the ref count checking code:
commit a5fff8d4b4d928311a5005efa12d0991fe3b66f9 (refs/bisect/bad)
Author: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Date: Wed Feb 27 16:14:30 2019 +0300
qcow2-refcount: avoid eating RAM
made the assumption that every cluster which was allocated would
have at least some data written to it. This was violated by way
the LUKS header is only partially written, with much space simply
reserved for future use.
Depending on the cluster size this problem was masked by the
logic which wrote zeros between the end of the LUKS header and
the end of the cluster.
$ qemu-img create --object secret,id=cluster_encrypt0,data=123456 \
-f qcow2 -o cluster_size=2k,encrypt.iter-time=1,\
encrypt.format=luks,encrypt.key-secret=cluster_encrypt0 \
cluster_size_check.qcow2 100M
Formatting 'cluster_size_check.qcow2', fmt=qcow2 size=104857600
encrypt.format=luks encrypt.key-secret=cluster_encrypt0
encrypt.iter-time=1 cluster_size=2048 lazy_refcounts=off refcount_bits=16
$ qemu-img check --object secret,id=cluster_encrypt0,data=redhat \
'json:{"driver": "qcow2", "encrypt.format": "luks", \
"encrypt.key-secret": "cluster_encrypt0", \
"file.driver": "file", "file.filename": "cluster_size_check.qcow2"}'
ERROR: counting reference for region exceeding the end of the file by one cluster or more: offset 0x2000 size 0x1f9000
Leaked cluster 4 refcount=1 reference=0
...snip...
Leaked cluster 130 refcount=1 reference=0
1 errors were found on the image.
Data may be corrupted, or further writes to the image may corrupt it.
127 leaked clusters were found on the image.
This means waste of disk space, but no harm to data.
Image end offset: 268288
The problem only exists when the disk image is entirely empty. Writing
data to the disk image payload will solve the problem by causing the
end of the file to be extended further.
The change fixes it by ensuring that the entire allocated LUKS header
region is fully initialized with zeros. The qemu-img check will still
fail for any pre-existing disk images created prior to this change,
unless at least 1 byte of the payload is written to.
Fully writing zeros to the entire LUKS header is a good idea regardless
as it ensures that space has been allocated on the host filesystem (or
whatever block storage backend is used).
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200207135520.2669430-1-berrange@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
2020-02-07 14:55:20 +01:00
|
|
|
284 rw
|
2020-01-17 11:58:59 +01:00
|
|
|
286 rw quick
|
2020-02-21 12:25:22 +01:00
|
|
|
288 quick
|
2020-03-11 15:07:07 +01:00
|
|
|
289 rw quick
|
2020-03-31 13:43:45 +02:00
|
|
|
290 rw auto quick
|