Am 09.02.2013 17:44, schrieb Stefan Hajnoczi: > bdrv_co_io_em(), bdrv_co_flush(), and bdrv_co_discard() yield the > coroutine when waiting for aio to complete. They do not check that the > request has actually finished. > > In simple cases this works, but it returns early when we get spurious > wake-ups due to qemu_coroutine_enter() being called from other sources. > One such example is block-migration.c:process_incoming_migration().
The bug is not in this function but in process_incoming_migration(). It should never blindly enter a coroutine which is in an unknown state. If it can reenter here, it can reenter anywhere in block drivers, and adding a workaround to one place that just yields again if it got an early reentrance doesn't fix the real bug. Which is the yield that corresponds to the enter in enter_migration_coroutine()? We need to add some state that can be used to make sure the enter happens only for this specific yield. Kevin