]> git.proxmox.com Git - mirror_qemu.git/commit
Fix alarm_timer race with select - v3 (Jan Kiszka)
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 5 Nov 2008 20:29:45 +0000 (20:29 +0000)
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Wed, 5 Nov 2008 20:29:45 +0000 (20:29 +0000)
commitc96f1a48d229a6080fecce4ea20bc64cabe79e32
tree2c58eb0d5ffadf171ba4926f38fda685283e591b
parentffd39257018269ee9cf1e39c531a6c546daaa408
Fix alarm_timer race with select - v3 (Jan Kiszka)

Changing the default IO timeout to 5 s (#5578) made a race visible
between the alarm_timer and select() in main_loop_wait(): If the timer
fired before select was able to block, the full select() timeout could
have been applied instead of returning immediately. Since #5578, this
causes heavy problems to the Musicpal board emulation with stalls up to
5 s, but also with some older Linux guest kernels.

The following patch introduces a pipe that is written to by
host_alarm_handler and select()'ed in main_loop_wait(). This avoids
prevents that select() blocks though a timer has fired and waits for
processing.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5633 c046a42c-6fe2-441c-8c8c-71466251a162
vl.c