qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Kazu" <kazoo@r3.dion.ne.jp>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Win32 MinGW build with current CVS
Date: Thu, 3 Aug 2006 12:14:19 +0900	[thread overview]
Message-ID: <001d01c6b6aa$e931ac00$0464a8c0@athlon> (raw)
In-Reply-To: op.tdn7edpmt9pcbo@mail.chello.hu

[-- Attachment #1: Type: text/plain, Size: 1001 bytes --]

Sent: Thursday, August 03, 2006 4:07 AM NyOS wrote:

On Wed, 02 Aug 2006 20:07:46 +0200, Andreas Bollhalder <bolle@geodb.org>
wrote:

>> Hello
>>
>> It seems that the aio support broke my MinGW build batch under Win32. Is
>> it suposed to work on WIN32 ?
>>
>> Any ideas ?
>>
>> Andreas
...

>Support for kernel AIO has been included in the 2.6 Linux kernel."

source:
http://lse.sourceforge.net/io/aio.html

>So, I don't think so. But please correct me, if I'm wrong.


Asynchronous I/O is implemented by overlapped I/O for Win32 but it is not
enabled.

I tried to make the program. A patch attached fixs compile errors.

I found some problems about it.
GetFileSizeEx needs to define WINVER 0x0500. It means that Windows 98/Me
host is not supported.
If we try to support Win 98/Me host, it is necessary to change configure to
use --enable-win9x and make another binary, etc.

The first attempt to open a hard disk image with a drive letter always
failed. After the second time is OK.

Regards,
Kazu


[-- Attachment #2: qemu-20060803-aio.patch --]
[-- Type: application/octet-stream, Size: 2598 bytes --]

Index: block-raw.c
===================================================================
RCS file: /sources/qemu/qemu/block-raw.c,v
retrieving revision 1.2
diff -u -r1.2 block-raw.c
--- block-raw.c	2 Aug 2006 22:02:08 -0000	1.2
+++ block-raw.c	3 Aug 2006 03:01:51 -0000
@@ -518,7 +518,6 @@
 #else /* _WIN32 */
 
 /* XXX: use another file ? */
-#include <windows.h>
 #include <winioctl.h>
 
 typedef struct BDRVRawState {
@@ -632,18 +631,17 @@
 static int raw_aio_new(BlockDriverAIOCB *acb)
 {
     RawAIOCB *acb1;
-    BDRVRawState *s = acb->bs->opaque;
 
     acb1 = qemu_mallocz(sizeof(RawAIOCB));
     if (!acb1)
         return -ENOMEM;
     acb->opaque = acb1;
-    s->hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
-    if (!s->hEvent)
+    acb1->hEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+    if (!acb1->hEvent)
         return -ENOMEM;
     return 0;
 }
-
+#ifndef QEMU_TOOL
 static void raw_aio_cb(void *opaque)
 {
     BlockDriverAIOCB *acb = opaque;
@@ -660,7 +658,7 @@
         acb->cb(acb->cb_opaque, 0);
     }
 }
-
+#endif
 static int raw_aio_read(BlockDriverAIOCB *acb, int64_t sector_num, 
                         uint8_t *buf, int nb_sectors)
 {
@@ -676,7 +674,9 @@
     acb1->ov.OffsetHigh = offset >> 32;
     acb1->ov.hEvent = acb1->hEvent;
     acb1->count = nb_sectors * 512;
+#ifndef QEMU_TOOL
     qemu_add_wait_object(acb1->ov.hEvent, raw_aio_cb, acb);
+#endif
     ret = ReadFile(s->hfile, buf, acb1->count, NULL, &acb1->ov);
     if (!ret)
         return -EIO;
@@ -698,7 +698,9 @@
     acb1->ov.OffsetHigh = offset >> 32;
     acb1->ov.hEvent = acb1->hEvent;
     acb1->count = nb_sectors * 512;
+#ifndef QEMU_TOOL
     qemu_add_wait_object(acb1->ov.hEvent, raw_aio_cb, acb);
+#endif
     ret = ReadFile(s->hfile, buf, acb1->count, NULL, &acb1->ov);
     if (!ret)
         return -EIO;
@@ -709,9 +711,11 @@
 {
     BlockDriverState *bs = acb->bs;
     BDRVRawState *s = bs->opaque;
+#ifndef QEMU_TOOL
     RawAIOCB *acb1 = acb->opaque;
 
     qemu_del_wait_object(acb1->ov.hEvent, raw_aio_cb, acb);
+#endif
     /* XXX: if more than one async I/O it is not correct */
     CancelIo(s->hfile);
 }
Index: vl.h
===================================================================
RCS file: /sources/qemu/qemu/vl.h,v
retrieving revision 1.137
diff -u -r1.137 vl.h
--- vl.h	1 Aug 2006 16:21:11 -0000	1.137
+++ vl.h	3 Aug 2006 03:01:53 -0000
@@ -46,6 +46,7 @@
 #endif
 
 #ifdef _WIN32
+#define WINVER 0x0500
 #include <windows.h>
 #define fsync _commit
 #define lseek _lseeki64

  reply	other threads:[~2006-08-03  3:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-02 18:07 [Qemu-devel] Win32 MinGW build with current CVS Andreas Bollhalder
2006-08-02 19:07 ` NyOS
2006-08-03  3:14   ` Kazu [this message]
2006-08-03  8:24     ` Kazu
  -- strict thread matches above, loose matches on Subject: below --
2006-08-03  8:41 ZIGLIO, Frediano, VF-IT
2006-08-03  8:58 ZIGLIO, Frediano, VF-IT

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001d01c6b6aa$e931ac00$0464a8c0@athlon' \
    --to=kazoo@r3.dion.ne.jp \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).