$NetBSD: patch-ay,v 1.7 2007/05/21 20:24:48 xtraeme Exp $ --- block-raw-posix.c.orig 2007-02-06 00:01:54.000000000 +0100 +++ block-raw-posix.c @@ -28,7 +28,9 @@ #endif #include "block_int.h" #include +#ifdef _POSIX_ASYNCHRONOUS_IO #include +#endif #ifdef CONFIG_COCOA #include @@ -230,6 +232,7 @@ static int raw_pwrite(BlockDriverState * return ret; } +#ifdef _POSIX_ASYNCHRONOUS_IO /***********************************************************/ /* Unix AIO using POSIX AIO */ @@ -455,6 +458,7 @@ static void raw_aio_cancel(BlockDriverAI pacb = &acb->next; } } +#endif static void raw_close(BlockDriverState *bs) { @@ -545,6 +549,35 @@ static void raw_flush(BlockDriverState * fsync(s->fd); } +#ifndef _POSIX_ASYNCHRONOUS_IO +void qemu_aio_init(void) +{ +} + +void qemu_aio_poll(void) +{ +} + +void qemu_aio_flush(void) +{ +} + +void qemu_aio_wait_start(void) +{ +} + +void qemu_aio_wait(void) +{ +#ifndef QEMU_IMG + qemu_bh_poll(); +#endif +} + +void qemu_aio_wait_end(void) +{ +} +#endif + BlockDriver bdrv_raw = { "raw", sizeof(BDRVRawState), @@ -556,10 +589,12 @@ BlockDriver bdrv_raw = { raw_create, raw_flush, +#ifdef _POSIX_ASYNCHRONOUS_IO .bdrv_aio_read = raw_aio_read, .bdrv_aio_write = raw_aio_write, .bdrv_aio_cancel = raw_aio_cancel, .aiocb_size = sizeof(RawAIOCB), +#endif .protocol_name = "file", .bdrv_pread = raw_pread, .bdrv_pwrite = raw_pwrite, @@ -908,10 +943,12 @@ BlockDriver bdrv_host_device = { NULL, raw_flush, +#ifdef _POSIX_ASYNCHRONOUS_IO .bdrv_aio_read = raw_aio_read, .bdrv_aio_write = raw_aio_write, .bdrv_aio_cancel = raw_aio_cancel, .aiocb_size = sizeof(RawAIOCB), +#endif .bdrv_pread = raw_pread, .bdrv_pwrite = raw_pwrite, .bdrv_getlength = raw_getlength,