qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] win32: build fixes due to io_flush removal
@ 2013-08-22 13:28 Stefan Hajnoczi
  2013-08-22 13:28 ` [Qemu-devel] [PATCH 1/2] aio-win32: replace incorrect AioHandler->opaque usage with ->e Stefan Hajnoczi
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2013-08-22 13:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil, Anthony Liguori, Stefan Hajnoczi

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(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 1/2] aio-win32: replace incorrect AioHandler->opaque usage with ->e
  2013-08-22 13:28 [Qemu-devel] [PATCH 0/2] win32: build fixes due to io_flush removal Stefan Hajnoczi
@ 2013-08-22 13:28 ` Stefan Hajnoczi
  2013-08-22 13:28 ` [Qemu-devel] [PATCH 2/2] win32-aio: drop win32_aio_flush_cb() Stefan Hajnoczi
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2013-08-22 13:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil, Anthony Liguori, Stefan Hajnoczi

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.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 aio-win32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/aio-win32.c b/aio-win32.c
index 78b2801..efb2d5a 100644
--- a/aio-win32.c
+++ b/aio-win32.c
@@ -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;
                 }
             }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 2/2] win32-aio: drop win32_aio_flush_cb()
  2013-08-22 13:28 [Qemu-devel] [PATCH 0/2] win32: build fixes due to io_flush removal Stefan Hajnoczi
  2013-08-22 13:28 ` [Qemu-devel] [PATCH 1/2] aio-win32: replace incorrect AioHandler->opaque usage with ->e Stefan Hajnoczi
@ 2013-08-22 13:28 ` Stefan Hajnoczi
  2013-08-22 14:33 ` [Qemu-devel] [PATCH 0/2] win32: build fixes due to io_flush removal Stefan Weil
  2013-08-22 20:05 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2013-08-22 13:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Weil, Anthony Liguori, Stefan Hajnoczi

The 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().

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/win32-aio.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/block/win32-aio.c b/block/win32-aio.c
index fcb7c75..5d1d199 100644
--- a/block/win32-aio.c
+++ b/block/win32-aio.c
@@ -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;
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] win32: build fixes due to io_flush removal
  2013-08-22 13:28 [Qemu-devel] [PATCH 0/2] win32: build fixes due to io_flush removal Stefan Hajnoczi
  2013-08-22 13:28 ` [Qemu-devel] [PATCH 1/2] aio-win32: replace incorrect AioHandler->opaque usage with ->e Stefan Hajnoczi
  2013-08-22 13:28 ` [Qemu-devel] [PATCH 2/2] win32-aio: drop win32_aio_flush_cb() Stefan Hajnoczi
@ 2013-08-22 14:33 ` Stefan Weil
  2013-08-22 20:05 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Weil @ 2013-08-22 14:33 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Anthony Liguori, qemu-devel

Am 22.08.2013 15:28, schrieb Stefan Hajnoczi:
> 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(-)
>

For both patches:

Reviewed-by: Stefan Weil <sw@weilnetz.de>

Hi Stefan,

thank you for the fast fix. Please include it in your pull request.

Regards,
Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH 0/2] win32: build fixes due to io_flush removal
  2013-08-22 13:28 [Qemu-devel] [PATCH 0/2] win32: build fixes due to io_flush removal Stefan Hajnoczi
                   ` (2 preceding siblings ...)
  2013-08-22 14:33 ` [Qemu-devel] [PATCH 0/2] win32: build fixes due to io_flush removal Stefan Weil
@ 2013-08-22 20:05 ` Stefan Hajnoczi
  3 siblings, 0 replies; 5+ messages in thread
From: Stefan Hajnoczi @ 2013-08-22 20:05 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Stefan Weil, Anthony Liguori, qemu-devel

On Thu, Aug 22, 2013 at 03:28:34PM +0200, Stefan Hajnoczi wrote:
> 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(-)

Applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-22 20:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-22 13:28 [Qemu-devel] [PATCH 0/2] win32: build fixes due to io_flush removal Stefan Hajnoczi
2013-08-22 13:28 ` [Qemu-devel] [PATCH 1/2] aio-win32: replace incorrect AioHandler->opaque usage with ->e Stefan Hajnoczi
2013-08-22 13:28 ` [Qemu-devel] [PATCH 2/2] win32-aio: drop win32_aio_flush_cb() Stefan Hajnoczi
2013-08-22 14:33 ` [Qemu-devel] [PATCH 0/2] win32: build fixes due to io_flush removal Stefan Weil
2013-08-22 20:05 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).