qemu/hw
Paolo Bonzini c9d1a56174 block: only call aio_poll on the current thread's AioContext
aio_poll is not thread safe; for example bdrv_drain can hang if
the last in-flight I/O operation is completed in the I/O thread after
the main thread has checked bs->in_flight.

The bug remains latent as long as all of it is called within
aio_context_acquire/aio_context_release, but this will change soon.

To fix this, if bdrv_drain is called from outside the I/O thread,
signal the main AioContext through a dummy bottom half.  The event
loop then only runs in the I/O thread.

Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1477565348-5458-18-git-send-email-pbonzini@redhat.com>
Signed-off-by: Fam Zheng <famz@redhat.com>
2016-10-28 21:50:18 +08:00
..
9pfs 9pfs: fix memory leak in v9fs_write 2016-10-17 14:13:58 +02:00
acpi pc: Leave max apic_id_limit only in legacy cpu hotplug code 2016-10-24 17:29:15 -02:00
adc STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00
alpha sun4uv: fix serial initialization regression 2016-10-24 15:27:20 +02:00
arm x86 and CPU queue, 2016-10-24 2016-10-25 10:25:27 +01:00
audio audio: intel-hda: check stream entry count during transfer 2016-10-26 14:51:44 +02:00
block virtio, pc: fixes and features 2016-10-10 16:23:40 +01:00
bt char: replace avail_connections 2016-10-24 15:46:10 +02:00
char char: remove explicit_fe_open, use a set_handlers argument 2016-10-24 15:46:10 +02:00
core hw/ptimer: Add "no counter round down" policy 2016-10-24 16:26:52 +01:00
cpu
cris cris: Fix broken header guard in hw/cris/boot.h 2016-07-12 16:20:46 +02:00
display virtio-gpu: fix memory leak in virtio_gpu_resource_create_2d 2016-10-26 14:52:21 +02:00
dma hw/dma/pl080: Fix bad bit mask (PL080_CONF_M1 | PL080_CONF_M1) 2016-10-17 19:22:17 +01:00
gpio
i2c i2c: Add asserts for second smbus i2c_start_transfer() 2016-10-24 16:48:02 +01:00
i386 pc: q35: Bump max_cpus to 288 2016-10-24 17:29:15 -02:00
ide Block layer patches 2016-10-04 14:25:08 +01:00
input virtio: cleanup VMSTATE_VIRTIO_DEVICE 2016-10-10 02:21:43 +03:00
intc pc: apic_common: Reset APIC ID to initial ID when switching into x2APIC mode 2016-10-24 17:29:15 -02:00
ipack
ipmi char: remove explicit_fe_open, use a set_handlers argument 2016-10-24 15:46:10 +02:00
isa char: remove init callback 2016-10-24 15:27:20 +02:00
lm32 Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
m68k m68k: change default system clock for m5208evb 2016-10-08 11:25:29 +03:00
mem trace: move hw/mem/pc-dimm.c trace points into correct file 2016-09-28 19:17:54 +01:00
microblaze Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
mips char: remove explicit_fe_open, use a set_handlers argument 2016-10-24 15:46:10 +02:00
misc char: remove explicit_fe_open, use a set_handlers argument 2016-10-24 15:46:10 +02:00
moxie
net net: rtl8139: limit processing of ring descriptors 2016-10-26 09:57:59 +08:00
nvram vl: Switch qemu_uuid to QemuUUID 2016-09-23 11:42:52 +08:00
openrisc
pci trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
pci-bridge hw/pci-bridge: Convert pxb initialization functions to Error 2016-07-29 00:07:09 +03:00
pci-host apb: convert init to realize 2016-07-29 00:07:09 +03:00
pcmcia
ppc Increase MAX_CPUMASK_BITS from 255 to 288 2016-10-24 17:29:15 -02:00
s390x s390x/css: {c,h,t,r,x}sch: require enable AND device number valid 2016-09-28 13:24:51 +02:00
scsi block: only call aio_poll on the current thread's AioContext 2016-10-28 21:50:18 +08:00
sd vmstateify ssi-sd 2016-09-22 18:13:08 +01:00
sh4 sh4: fix broken link to documentation 2016-09-15 15:32:22 +03:00
smbios smbios: fix uuid copy 2016-09-29 11:43:22 +08:00
sparc intc: make HMP 'info irq' and 'info pic' commands use InterruptStatsProvider interface 2016-10-04 10:00:25 +02:00
sparc64 sun4uv: fix serial initialization regression 2016-10-24 15:27:20 +02:00
ssi xilinx: fix buffer overflow on realize 2016-10-24 15:27:20 +02:00
timer timer: stm32f2xx_timer: add check for prescaler value 2016-10-24 16:26:55 +01:00
tpm Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
tricore tricore: remove useless cast 2016-09-15 15:32:22 +03:00
unicore32
usb * KVM run_on_cpu fix (Alex) 2016-10-24 15:03:09 +01:00
vfio vfio: fix duplicate function call 2016-10-17 10:58:03 -06:00
virtio char: use qemu_chr_fe* functions with CharBackend argument 2016-10-24 15:27:21 +02:00
watchdog
xen Xen: fix converity warning of xen_pt_config_init() 2016-08-12 16:38:18 -07:00
xenpv xenpv: Fix qemu_uuid compiling error 2016-09-29 11:43:17 +08:00
xtensa char: remove init callback 2016-10-24 15:27:20 +02:00
Makefile.objs STM32F2xx: Add the ADC device 2016-10-04 13:28:07 +01:00