Skip to contentSkip to conversation

aio: fix aio_ctx_prepare with idle bottom halves

PATCH Applied Paolo Bonzini 2 participants 2 messages Nov 12, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
Untested, I don't have an image that can do SB16. malc, can you test and perhaps apply?

 async.c | 6 ++----

1 file modificato, 2 inserzioni(+), 4 rimozioni(-)

async.c +2 -4
index 04f9dcb..3f0e8f3 100644
@@ -122,11 +122,9 @@ aio_ctx_prepare(GSource *source, gint    *timeout)
 {
     AioContext *ctx = (AioContext *) source;
     QEMUBH *bh;
-    bool scheduled = false;
 
     for (bh = ctx->first_bh; bh; bh = bh->next) {
         if (!bh->deleted && bh->scheduled) {
-            scheduled = true;
             if (bh->idle) {
                 /* idle bottom halves will be polled at least
                  * every 10ms */
@@ -135,12 +133,12 @@ aio_ctx_prepare(GSource *source, gint    *timeout)
                 /* non-idle bottom halves will be executed
                  * immediately */
                 *timeout = 0;
-                break;
+                return true;
             }
         }
     }
 
-    return scheduled;
+    return false;
 }
 
 static gboolean
Signature · 1 line
1.7.12.1
Applied
#1 lore raw
Quoted 6 lines · Paolo Bonzini

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.

Applied, thanks.

[..snip..]

Signature · 1 line
mailto:[email protected]