From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G8TfI-0000Ca-N5 for qemu-devel@nongnu.org; Wed, 02 Aug 2006 23:14:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G8TfF-0000Bk-JO for qemu-devel@nongnu.org; Wed, 02 Aug 2006 23:14:28 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G8TfF-0000BN-D3 for qemu-devel@nongnu.org; Wed, 02 Aug 2006 23:14:25 -0400 Received: from [211.5.2.81] (helo=nm01omta01d.dion.ne.jp) by monty-python.gnu.org with smtp (Exim 4.52) id 1G8TiU-0007Cg-Km for qemu-devel@nongnu.org; Wed, 02 Aug 2006 23:17:47 -0400 Message-ID: <001d01c6b6aa$e931ac00$0464a8c0@athlon> From: "Kazu" References: <44D0E9F2.1090202@geodb.org> Subject: Re: [Qemu-devel] Win32 MinGW build with current CVS Date: Thu, 3 Aug 2006 12:14:19 +0900 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0018_01C6B6F6.58B08010" Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. ------=_NextPart_000_0018_01C6B6F6.58B08010 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Sent: Thursday, August 03, 2006 4:07 AM NyOS wrote: On Wed, 02 Aug 2006 20:07:46 +0200, Andreas Bollhalder 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 ------=_NextPart_000_0018_01C6B6F6.58B08010 Content-Type: application/octet-stream; name="qemu-20060803-aio.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="qemu-20060803-aio.patch" Index: block-raw.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /sources/qemu/qemu/block-raw.c,v=0A= retrieving revision 1.2=0A= diff -u -r1.2 block-raw.c=0A= --- block-raw.c 2 Aug 2006 22:02:08 -0000 1.2=0A= +++ block-raw.c 3 Aug 2006 03:01:51 -0000=0A= @@ -518,7 +518,6 @@=0A= #else /* _WIN32 */=0A= =0A= /* XXX: use another file ? */=0A= -#include =0A= #include =0A= =0A= typedef struct BDRVRawState {=0A= @@ -632,18 +631,17 @@=0A= static int raw_aio_new(BlockDriverAIOCB *acb)=0A= {=0A= RawAIOCB *acb1;=0A= - BDRVRawState *s =3D acb->bs->opaque;=0A= =0A= acb1 =3D qemu_mallocz(sizeof(RawAIOCB));=0A= if (!acb1)=0A= return -ENOMEM;=0A= acb->opaque =3D acb1;=0A= - s->hEvent =3D CreateEvent(NULL, TRUE, FALSE, NULL);=0A= - if (!s->hEvent)=0A= + acb1->hEvent =3D CreateEvent(NULL, TRUE, FALSE, NULL);=0A= + if (!acb1->hEvent)=0A= return -ENOMEM;=0A= return 0;=0A= }=0A= -=0A= +#ifndef QEMU_TOOL=0A= static void raw_aio_cb(void *opaque)=0A= {=0A= BlockDriverAIOCB *acb =3D opaque;=0A= @@ -660,7 +658,7 @@=0A= acb->cb(acb->cb_opaque, 0);=0A= }=0A= }=0A= -=0A= +#endif=0A= static int raw_aio_read(BlockDriverAIOCB *acb, int64_t sector_num, =0A= uint8_t *buf, int nb_sectors)=0A= {=0A= @@ -676,7 +674,9 @@=0A= acb1->ov.OffsetHigh =3D offset >> 32;=0A= acb1->ov.hEvent =3D acb1->hEvent;=0A= acb1->count =3D nb_sectors * 512;=0A= +#ifndef QEMU_TOOL=0A= qemu_add_wait_object(acb1->ov.hEvent, raw_aio_cb, acb);=0A= +#endif=0A= ret =3D ReadFile(s->hfile, buf, acb1->count, NULL, &acb1->ov);=0A= if (!ret)=0A= return -EIO;=0A= @@ -698,7 +698,9 @@=0A= acb1->ov.OffsetHigh =3D offset >> 32;=0A= acb1->ov.hEvent =3D acb1->hEvent;=0A= acb1->count =3D nb_sectors * 512;=0A= +#ifndef QEMU_TOOL=0A= qemu_add_wait_object(acb1->ov.hEvent, raw_aio_cb, acb);=0A= +#endif=0A= ret =3D ReadFile(s->hfile, buf, acb1->count, NULL, &acb1->ov);=0A= if (!ret)=0A= return -EIO;=0A= @@ -709,9 +711,11 @@=0A= {=0A= BlockDriverState *bs =3D acb->bs;=0A= BDRVRawState *s =3D bs->opaque;=0A= +#ifndef QEMU_TOOL=0A= RawAIOCB *acb1 =3D acb->opaque;=0A= =0A= qemu_del_wait_object(acb1->ov.hEvent, raw_aio_cb, acb);=0A= +#endif=0A= /* XXX: if more than one async I/O it is not correct */=0A= CancelIo(s->hfile);=0A= }=0A= Index: vl.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /sources/qemu/qemu/vl.h,v=0A= retrieving revision 1.137=0A= diff -u -r1.137 vl.h=0A= --- vl.h 1 Aug 2006 16:21:11 -0000 1.137=0A= +++ vl.h 3 Aug 2006 03:01:53 -0000=0A= @@ -46,6 +46,7 @@=0A= #endif=0A= =0A= #ifdef _WIN32=0A= +#define WINVER 0x0500=0A= #include =0A= #define fsync _commit=0A= #define lseek _lseeki64=0A= ------=_NextPart_000_0018_01C6B6F6.58B08010--