X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=aio-win32.c;h=38723bf1d37160a6de72763100f42fd66c401449;hb=66a96d7018b9cbabb73c9b87b62a37e4cc46580a;hp=a84eb712460df2463ac859865272d319db45c63a;hpb=4ba79505f43bd0ace35c3fe42197eb02e7e0478e;p=qemu.git diff --git a/aio-win32.c b/aio-win32.c index a84eb7124..38723bf1d 100644 --- a/aio-win32.c +++ b/aio-win32.c @@ -16,9 +16,9 @@ */ #include "qemu-common.h" -#include "block.h" -#include "qemu-queue.h" -#include "qemu_socket.h" +#include "block/block.h" +#include "qemu/queue.h" +#include "qemu/sockets.h" struct AioHandler { EventNotifier *e; @@ -173,7 +173,7 @@ bool aio_poll(AioContext *ctx, bool blocking) } /* wait until next event */ - for (;;) { + while (count > 0) { int timeout = blocking ? INFINITE : 0; int ret = WaitForMultipleObjects(count, events, FALSE, timeout); @@ -209,7 +209,11 @@ bool aio_poll(AioContext *ctx, bool blocking) g_free(tmp); } } + + /* Try again, but only call each handler once. */ + events[ret - WAIT_OBJECT_0] = events[--count]; } - return progress; + assert(progress || busy); + return true; }