qemu/tests/qemu-iotests
Stefan Hajnoczi f389309d29 monitor: only run coroutine commands in qemu_aio_context
monitor_qmp_dispatcher_co() runs in the iohandler AioContext that is not
polled during nested event loops. The coroutine currently reschedules
itself in the main loop's qemu_aio_context AioContext, which is polled
during nested event loops. One known problem is that QMP device-add
calls drain_call_rcu(), which temporarily drops the BQL, leading to all
sorts of havoc like other vCPU threads re-entering device emulation code
while another vCPU thread is waiting in device emulation code with
aio_poll().

Paolo Bonzini suggested running non-coroutine QMP handlers in the
iohandler AioContext. This avoids trouble with nested event loops. His
original idea was to move coroutine rescheduling to
monitor_qmp_dispatch(), but I resorted to moving it to qmp_dispatch()
because we don't know if the QMP handler needs to run in coroutine
context in monitor_qmp_dispatch(). monitor_qmp_dispatch() would have
been nicer since it's associated with the monitor implementation and not
as general as qmp_dispatch(), which is also used by qemu-ga.

A number of qemu-iotests need updated .out files because the order of
QMP events vs QMP responses has changed.

Solves Issue #1933.

Cc: qemu-stable@nongnu.org
Fixes: 7bed89958bfbf40df9ca681cefbdca63abdde39d ("device_core: use drain_call_rcu in in qmp_device_add")
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2215192
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2214985
Buglink: https://issues.redhat.com/browse/RHEL-17369
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-ID: <20240118144823.1497953-4-stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Tested-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit effd60c878176bcaf97fa7ce2b12d04bb8ead6f7)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2024-01-26 19:31:33 +03:00
..
001
002
003
004
005
007
008
009
010
011
012
013
014
015
017
018
019
020
021
023
025
026
027
028
029
2023-09-08 13:08:52 +03:00
031
032
033
034
035
036
037
038
039
042
043
044
046
2023-09-08 13:08:52 +03:00
047
048
049
050
051
2022-10-27 20:13:32 +02:00
052
053
054
057
058
060
061
2023-09-08 13:08:52 +03:00
062
063
064
065
2023-02-01 16:52:33 +01:00
066
068
069
070
071
2023-09-08 13:08:52 +03:00
072
073
074
075
076
077
078
079
080
081
082
083
084
085
086
087
088
089
090
091
092
094
095
096
097
098
099
101
102
103
104
105
107
110
111
112
113
114
115
116
117
118
2023-10-31 13:51:33 +01:00
119
120
121
122
123
125
126
127
128
130
133
134
135
136
137
138
140
142
143
144
145
146
148
150
153
154
156
157
158
159
160
161
162
163
170
171
173
174
175
176
177
178
179
182
184
187
188
189
190
191
192
195
197
2023-09-08 10:06:25 -04:00
198
200
201
202
203
204
206
207
208
209
210
211
212
213
215
2023-09-08 13:08:52 +03:00
216
217
219
220
221
223
224
225
226
227
228
229
231
232
233
234
235
236
237
238
239
240
241
242
243
244
246
247
248
249
250
251
252
253
254
255
256
2023-10-12 14:21:43 -04:00
257
2023-10-12 14:21:43 -04:00
258
259
260
261
263
265
266
267
268
270
272
273
274
277
279
280
282
283
284
286
287
288
289
290
292
293
294
297
299
301
302
303
304
305
307
310
313
2023-10-04 11:03:54 -07:00
2023-09-08 13:08:52 +03: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.