mirror of
https://git.proxmox.com/git/qemu
synced 2025-06-15 14:32:03 +00:00
aio: fix aio_ctx_prepare with idle bottom halves
Commit ed2aec4867f0d5f5de496bb765347b5d0cfe113d changed the return value of aio_ctx_prepare from false to true when only idle bottom halves are available. This broke PC old-style DMA, which uses them. Fix this by making aio_ctx_prepare return true only when non-idle bottom halves are scheduled to run. Reported-by: malc <av1474@comtv.ru> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: malc <av1474@comtv.ru>
This commit is contained in:
parent
3c5645fab3
commit
f5022a135e
6
async.c
6
async.c
@ -122,11 +122,9 @@ aio_ctx_prepare(GSource *source, gint *timeout)
|
|||||||
{
|
{
|
||||||
AioContext *ctx = (AioContext *) source;
|
AioContext *ctx = (AioContext *) source;
|
||||||
QEMUBH *bh;
|
QEMUBH *bh;
|
||||||
bool scheduled = false;
|
|
||||||
|
|
||||||
for (bh = ctx->first_bh; bh; bh = bh->next) {
|
for (bh = ctx->first_bh; bh; bh = bh->next) {
|
||||||
if (!bh->deleted && bh->scheduled) {
|
if (!bh->deleted && bh->scheduled) {
|
||||||
scheduled = true;
|
|
||||||
if (bh->idle) {
|
if (bh->idle) {
|
||||||
/* idle bottom halves will be polled at least
|
/* idle bottom halves will be polled at least
|
||||||
* every 10ms */
|
* every 10ms */
|
||||||
@ -135,12 +133,12 @@ aio_ctx_prepare(GSource *source, gint *timeout)
|
|||||||
/* non-idle bottom halves will be executed
|
/* non-idle bottom halves will be executed
|
||||||
* immediately */
|
* immediately */
|
||||||
*timeout = 0;
|
*timeout = 0;
|
||||||
break;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return scheduled;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
Loading…
Reference in New Issue
Block a user