/[qemu]
ViewVC logotype

Revision 5572


Jump to revision: Previous Next
Author: aliguori
Date: Fri Oct 31 17:24:21 2008 UTC (15 years ago)
Changed paths: 2
Log Message:
Make bottom halves more robust

Bottom halves are supposed to not complete until the next iteration of the main
loop.  This is very important to ensure that guests can not cause stack
overflows in the block driver code.  Right now, if you attempt to schedule a
bottom half within a bottom half callback, you will enter an infinite loop.

This patch uses the same logic that we use for the IOHandler loop to make the
bottom half processing robust in list manipulation while in a callback.

This patch also introduces idle scheduling for bottom halves.  qemu_bh_poll()
returns an indication of whether any bottom halves were successfully executed.
qemu_aio_wait() uses this to immediately return if a bottom half was executed
instead of waiting for a completion notification.

qemu_bh_schedule_idle() works around this by not reporting the callback has
run in the qemu_bh_poll loop.  qemu_aio_wait() probably needs some refactoring
but that would require a larger code audit.  idle scheduling seems like a good
compromise.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



Changed paths:

Path Details
Directorytrunk/qemu-common.h modified , text changed
Directorytrunk/vl.c modified , text changed

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.5