win32: build fixes due to io_flush removal
cover win32: build fixes due to io_flush removal
Stefan Weil noticed that the win32 build is broken with my io_flush changes applied. The issues are simple build failures that should have been avoided by test building Windows, which I didn't.
To make amends I've set up a mingw cross-compiler and have fixed the build. Sorry for the breakage.
I can include this in my block pull request later today if you are happy with the patches.
Stefan Hajnoczi (2):
aio-win32: replace incorrect AioHandler->opaque usage with ->e
win32-aio: drop win32_aio_flush_cb()
aio-win32.c | 4 ++-- block/win32-aio.c | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-)
Signature · 1 line
1.8.3.1
PATCH 1/2 aio-win32: replace incorrect AioHandler->opaque usage with ->e
The AioHandler->opaque field does not exist in aio-win32.c. The code that uses it was incorrectly copied from aio-posix.c. For Windows we can use AioHandler->e to match against AioContext->notifier.
This patch fixes the Windows build for aio-win32.o.
--- aio-win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
aio-win32.c +2 -2
@@ -125,7 +125,7 @@ bool aio_poll(AioContext *ctx, bool blocking) node->io_notify (node->e);/* aio_notify() does not count as progress */ -if (node->opaque != &ctx->notifier) { +if (node->e != &ctx->notifier) { progress = true; } }
@@ -188,7 +188,7 @@ bool aio_poll(AioContext *ctx, bool blocking) node->io_notify (node->e);/* aio_notify() does not count as progress */ -if (node->opaque != &ctx->notifier) { +if (node->e != &ctx->notifier) { progress = true; } }
Signature · 1 line
1.8.3.1
PATCH 2/2 win32-aio: drop win32_aio_flush_cb()
In reply to Stefan HajnocziThe io_flush argument to qemu_aio_set_event_notifier() has been removed since the block layer learnt to drain requests by itself. Fix the Windows build for win32-aio.o by updating the qemu_aio_set_event_notifier() call and dropping win32_aio_flush_cb().
--- block/win32-aio.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
block/win32-aio.c +1 -9
@@ -105,13 +105,6 @@ static void win32_aio_completion_cb(EventNotifier *e) } } -static int win32_aio_flush_cb (EventNotifier *e) -{ -QEMUWin32AIOState *s =container_of (e, QEMUWin32AIOState, e); - -return (s->count >0 ) ?1 :0 ; -} -static void win32_aio_cancel (BlockDriverAIOCB *blockacb) {QEMUWin32AIOCB *waiocb = (QEMUWin32AIOCB *)blockacb;
@@ -201,8 +194,7 @@ QEMUWin32AIOState *win32_aio_init(void) goto out_close_efd; } -qemu_aio_set_event_notifier (&s->e, win32_aio_completion_cb, - win32_aio_flush_cb); +qemu_aio_set_event_notifier (&s->e, win32_aio_completion_cb);return s;
Signature · 1 line
1.8.3.1
Am 22.08.2013 15:28, schrieb Stefan Hajnoczi:
Quoted 10 lines
Stefan Weil noticed that the win32 build is broken with my
io_flushchanges applied. The issues are simple build failures that should have been avoided by test building Windows, which I didn't.To make amends I've set up a mingw cross-compiler and have fixed the build. Sorry for the breakage.
I can include this in my block pull request later today if you are happy with the patches.
Quoted 8 lines
Stefan Hajnoczi (2):
aio-win32: replace incorrectAioHandler->opaqueusage with ->e
win32-aio: dropwin32_aio_flush_cb()aio-win32.c | 4 ++-- block/win32-aio.c | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-)
For both patches:
Hi Stefan,
thank you for the fast fix. Please include it in your pull request.
Regards,
Stefan
Stefan Hajnoczi
AppliedQuoted 10 lines · Stefan Hajnoczi
Stefan Weil noticed that the win32 build is broken with my
io_flushchanges applied. The issues are simple build failures that should have been avoided by test building Windows, which I didn't.To make amends I've set up a mingw cross-compiler and have fixed the build. Sorry for the breakage.
I can include this in my block pull request later today if you are happy with the patches.
Quoted 7 lines
Stefan Hajnoczi (2):
aio-win32: replace incorrectAioHandler->opaqueusage with ->e
win32-aio: dropwin32_aio_flush_cb()aio-win32.c | 4 ++-- block/win32-aio.c | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-)
Applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan