Skip to content
  • Anthony Liguori's avatar
    Fix alarm_timer race with select - v3 (Jan Kiszka) · c96f1a48
    Anthony Liguori authored
    
    
    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: default avatarJan Kiszka <jan.kiszka@web.de>
    Signed-off-by: default avatarAnthony Liguori <aliguori@us.ibm.com>
    
    
    
    git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5633 c046a42c-6fe2-441c-8c8c-71466251a162
    c96f1a48