qemu/tests/qemu-iotests
Markus Armbruster 6172e067a4 fdc: Reject clash between -drive if=floppy and -global isa-fdc
The floppy controller devices desugar their drive properties into
floppy devices (since commit a92bd191a4 "fdc: Move qdev properties to
FloppyDrive", v2.8.0).  This involves some bad magic in
fdctrl_connect_drives(), and exists for backward compatibility.

The functions for boards to create floppy controller devices
fdctrl_init_isa(), fdctrl_init_sysbus(), and sun4m_fdctrl_init()
desugar -drive if=floppy to these floppy controller drive properties.

If you use both -drive if=floppy (or its -fda / -fdb sugar) and
-global isa-fdc for the same floppy device, -global silently loses the
conflict, and both backends involved end up with the floppy device
frontend attached, as demonstrated by iotest 172 (see commit before
previous).  This is wrong.

Desugar -drive if=floppy straight to floppy devices instead, with
helper fdctrl_init_drives().  The conflict now gets rejected cleanly:
first, fdctrl_connect_drives() creates the floppy for the controller's
property, then fdctrl_init_drives() attempts to create the floppy for
-drive if=floppy, but fails because the unit is already in use.

Output of iotest 172 changes in three ways:

1. The clash gets rejected.

2. In one test case, "info qtree" has the floppy devices swapped, and
   "info block" has their QOM paths swapped.  This is because the
   floppy device for -fda now gets created after the one for -global
   isa-fdc.driveB.

3. The error message for -global floppy.drive=floppy0 changes.  Before
   the patch, we set isa-fdc.driveA to -fda's block backend, then
   create the floppy device for it, then move the backend from
   isa-fdc.driveA to floppy.drive.  Floppy creation fails when
   applying -global floppy.drive=floppy0, because floppy0 is still
   attached to isa-fdc.  After the patch, we create the floppy for
   -fda, then set its drive property to floppy0.  Now floppy creation
   succeeds, but setting the drive property fails, because -global
   already set it.  Yes, this is exasperatingly complicated.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200622094227.1271650-5-armbru@redhat.com>
2020-06-23 16:07:07 +02:00
..
001
2020-05-05 13:17:36 +02:00
003
004
005
007
008
009
010
011
012
013
014
015
017
018
019
020
021
022
023
024
025
027
028
029
031
032
033
034
035
037
038
039
040
042
043
044
045
047
048
049
050
051
052
2020-05-05 13:17:36 +02:00
053
054
056
057
058
062
063
065
2020-05-13 14:20:31 +02:00
066
067
068
069
071
072
073
074
075
076
077
078
079
080
2020-05-13 14:20:31 +02:00
081
082
2020-05-08 13:26:35 +02:00
083
084
085
2020-03-24 11:57:38 +01:00
086
087
2020-03-24 11:57:38 +01:00
088
089
090
091
2020-05-08 13:26:35 +02:00
092
093
094
095
096
097
098
099
101
102
103
104
105
106
107
108
110
111
112
114
115
116
117
119
120
121
123
124
125
126
127
128
129
130
131
132
133
134
2020-05-05 13:17:36 +02:00
135
136
2016-05-19 16:45:31 +02:00
137
139
140
141
142
144
145
146
147
148
2020-05-08 13:26:35 +02:00
149
2020-05-05 13:17:36 +02:00
150
151
152
153
2020-05-05 13:17:36 +02:00
2020-05-05 13:17:36 +02:00
154
2020-03-11 15:54:38 +01:00
156
157
158
159
160
161
162
163
165
169
170
171
173
174
175
176
2020-05-28 13:15:23 -05:00
179
181
182
183
184
185
186
187
188
2020-05-05 13:17:36 +02:00
189
191
192
195
196
197
198
199
200
201
202
2020-05-05 13:17:36 +02:00
203
2020-05-05 13:17:36 +02:00
204
205
206
2020-05-05 13:17:36 +02:00
207
2020-05-05 13:17:36 +02:00
208
2020-05-05 13:17:36 +02:00
209
2020-05-05 13:17:36 +02:00
210
2020-05-05 13:17:36 +02:00
211
2020-05-05 13:17:36 +02:00
212
2020-05-05 13:17:36 +02:00
213
2020-05-05 13:17:36 +02:00
215
216
2020-05-05 13:17:36 +02:00
217
218
2020-05-05 13:17:36 +02:00
219
2020-05-05 13:17:36 +02:00
220
221
222
2020-05-05 13:17:36 +02:00
224
2020-05-05 13:17:36 +02:00
225
226
227
228
2020-05-05 13:17:36 +02:00
229
2020-06-17 16:21:21 +02:00
231
232
233
234
2020-05-05 13:17:36 +02:00
235
2020-05-05 13:17:36 +02:00
236
2020-05-05 13:17:36 +02:00
237
2020-05-05 13:17:36 +02:00
238
2020-05-05 13:17:36 +02:00
239
240
241
242
2020-05-05 13:17:36 +02:00
243
246
2020-05-05 13:17:36 +02:00
247
248
2020-05-05 13:17:36 +02:00
249
250
251
252
253
254
2020-05-05 13:17:36 +02:00
255
2020-05-05 13:17:36 +02:00
256
2020-05-05 13:17:36 +02:00
257
258
2020-05-05 13:17:36 +02:00
260
2020-05-05 13:17:36 +02:00
261
262
2020-05-05 13:17:36 +02:00
263
264
2020-05-05 13:17:36 +02:00
265
267
268
270
272
273
274
2020-05-05 13:17:36 +02:00
277
2020-05-05 13:17:36 +02:00
279
2020-03-24 11:57:38 +01:00
280
2020-05-05 13:17:36 +02:00
281
286
2020-02-20 16:43:42 +01:00
292
2020-06-17 16:21:21 +02:00
297
2020-05-18 19:05:25 +02:00
2020-05-08 13:26:35 +02: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.