]> git.proxmox.com Git - mirror_qemu.git/blobdiff - async.c
block: move include files to include/block/
[mirror_qemu.git] / async.c
diff --git a/async.c b/async.c
index 04f9dcbb4d07cc4015f54ffdd5aa8c6f44c3d9cd..6df4caf68a3b0920a5dceeae57f5f0e1b1f4d3a6 100644 (file)
--- a/async.c
+++ b/async.c
@@ -23,7 +23,7 @@
  */
 
 #include "qemu-common.h"
-#include "qemu-aio.h"
+#include "block/aio.h"
 #include "main-loop.h"
 
 /***********************************************************/
@@ -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
@@ -217,8 +215,3 @@ void aio_context_unref(AioContext *ctx)
 {
     g_source_unref(&ctx->source);
 }
-
-void aio_flush(AioContext *ctx)
-{
-    while (aio_poll(ctx, true));
-}