qemu-e2k/tests
Paolo Bonzini acfb23ad3d AioContext: do not rely on aio_poll(ctx, true) result to end a loop
Currently, whenever aio_poll(ctx, true) has completed all pending
work it returns true *and* the next call to aio_poll(ctx, true)
will not block.

This invariant has its roots in qemu_aio_flush()'s implementation
as "while (qemu_aio_wait()) {}".  However, qemu_aio_flush() does
not exist anymore and bdrv_drain_all() is implemented differently;
and this invariant is complicated to maintain and subtly different
from the return value of GMainLoop's g_main_context_iteration.

All calls to aio_poll(ctx, true) except one are guarded by a
while() loop checking for a request to be incomplete, or a
BlockDriverState to be idle.  The one remaining call (in
iothread.c) uses this to delay the aio_context_release/acquire
pair until the AioContext is quiescent, however:

- we can do the same just by using non-blocking aio_poll,
  similar to how vl.c invokes main_loop_wait

- it is buggy, because it does not ensure that the AioContext
  is released between an aio_notify and the next time the
  iothread goes to sleep.  This leads to hangs when stopping
  the dataplane thread.

In the end, these semantics are a bad match for the current
users of AioContext.  So modify that one exception in iothread.c,
which also fixes the hangs, as well as the testcase so that
it use the same idiom as the actual QEMU code.

Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-07-14 12:03:20 +02:00
..
acpi-test-data acpi-test: update expected tables 2014-06-19 16:41:53 +03:00
libqos qtest: fix qpci_config_writel 2014-06-02 16:28:59 +02:00
multiboot
qapi-schema qapi script: clean up in scripts 2014-06-27 09:27:56 -04:00
qemu-iotests block/backup: Fix hang for unaligned image size 2014-07-09 15:50:11 +02:00
tcg Xtensa fixes queue 2014-05-26: 2014-05-28 14:47:35 +01:00
vmstate-static-checker-data tests: vmstate static checker: add size mismatch inside substructure 2014-06-23 19:14:52 +02:00
.gitignore
ac97-test.c
bios-tables-test.c tests: add smbios testing 2014-05-27 23:42:16 +03:00
blockdev-test.c
boot-order-test.c
check-block.sh
check-qdict.c
check-qfloat.c
check-qint.c
check-qjson.c json-lexer: fix escaped backslash in single-quoted string 2014-06-23 11:01:24 -04:00
check-qlist.c
check-qom-interface.c
check-qstring.c
display-vga-test.c
e1000-test.c e1000: remove broken support for 82573L 2014-06-09 15:38:58 +02:00
eepro100-test.c
endianness-test.c
es1370-test.c
fdc-test.c libqtest: escape strings in QMP commands, fix leak 2014-07-01 10:20:41 +02:00
fw_cfg-test.c
hd-geo-test.c
i440fx-test.c
i82801b11-test.c
ide-test.c
intel-hda-test.c
ioh3420-test.c
ipoctal232-test.c
libqtest.c libqtest: escape strings in QMP commands, fix leak 2014-07-01 10:20:41 +02:00
libqtest.h
m48t59-test.c
Makefile qtest: enable vhost-user-test 2014-07-06 09:13:53 +03:00
ne2000-test.c
nvme-test.c
pcnet-test.c
pvpanic-test.c
qdev-monitor-test.c
qemu-iotests-quick.sh iotests: Simplify qemu-iotests-quick.sh 2014-07-01 10:15:33 +02:00
qom-test.c libqtest: escape strings in QMP commands, fix leak 2014-07-01 10:20:41 +02:00
rtc-test.c
rtl8139-test.c
spapr-phb-test.c
test-aio.c AioContext: do not rely on aio_poll(ctx, true) result to end a loop 2014-07-14 12:03:20 +02:00
test-bitops.c
test-coroutine.c
test-cutils.c
test-hbitmap.c
test-int128.c
test-iov.c
test-mul64.c
test-opts-visitor.c
test-qdev-global-props.c qdev: Add test of qdev_prop_check_global 2014-06-05 19:20:38 +03:00
test-qemu-opts.c QemuOpt: add unit tests 2014-05-28 14:27:42 +02:00
test-qmp-commands.c
test-qmp-event.c tests/test-qmp-event: fix for GLib < 2.31 2014-06-30 15:06:11 +02:00
test-qmp-input-strict.c
test-qmp-input-visitor.c
test-qmp-output-visitor.c tests: Check empty QMP output visitor 2014-05-28 17:36:09 +02:00
test-rfifolock.c
test-string-input-visitor.c tests: simplify code 2014-06-19 18:44:22 +03:00
test-string-output-visitor.c tests: add human format test for string output visitor 2014-06-29 19:39:43 +03:00
test-thread-pool.c block: drop aio functions that operate on the main AioContext 2014-07-09 15:50:11 +02:00
test-throttle.c throttle: add detach/attach test case 2014-06-04 09:56:12 +02:00
test-visitor-serialization.c
test-vmstate.c vmstate: Refactor & increase tests for primitive types 2014-06-23 19:14:52 +02:00
test-x86-cpuid.c
test-xbzrle.c
tmp105-test.c libqtest: escape strings in QMP commands, fix leak 2014-07-01 10:20:41 +02:00
tpci200-test.c
usb-hcd-ehci-test.c usb: improve ehci/uhci test 2014-06-02 16:28:59 +02:00
vhost-user-test.c qtest: fix vhost-user-test unbalanced mutex locks 2014-06-23 17:37:59 +03:00
virtio-9p-test.c
virtio-balloon-test.c
virtio-blk-test.c
virtio-console-test.c
virtio-net-test.c
virtio-rng-test.c
virtio-scsi-test.c
virtio-serial-test.c
vmxnet3-test.c