aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-08-07 19:10:16 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-08-07 19:10:16 +0000
commit90765429aab64478e4dd9de3bbb21e5eafb5ead5 (patch)
treedb21035508e308a1c246487e67f50cc5bc33fc62 /block.c
parentce1a14dc0d94cf85393356f56f197c5e8b6a7f60 (diff)
fixed aio emulation
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2099 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block.c')
-rw-r--r--block.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/block.c b/block.c
index 0c2fc6ea84..d81451058e 100644
--- a/block.c
+++ b/block.c
@@ -35,6 +35,12 @@
#define SECTOR_BITS 9
#define SECTOR_SIZE (1 << SECTOR_BITS)
+typedef struct BlockDriverAIOCBSync {
+ BlockDriverAIOCB common;
+ QEMUBH *bh;
+ int ret;
+} BlockDriverAIOCBSync;
+
static BlockDriverAIOCB *bdrv_aio_read_em(BlockDriverState *bs,
int64_t sector_num, uint8_t *buf, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque);
@@ -111,6 +117,7 @@ void bdrv_register(BlockDriver *bdrv)
bdrv->bdrv_aio_read = bdrv_aio_read_em;
bdrv->bdrv_aio_write = bdrv_aio_write_em;
bdrv->bdrv_aio_cancel = bdrv_aio_cancel_em;
+ bdrv->aiocb_size = sizeof(BlockDriverAIOCBSync);
} else if (!bdrv->bdrv_read && !bdrv->bdrv_pread) {
/* add synchronous IO emulation layer */
bdrv->bdrv_read = bdrv_read_em;
@@ -1061,14 +1068,6 @@ static void bdrv_aio_cancel_em(BlockDriverAIOCB *acb)
{
}
#else
-typedef struct BlockDriverAIOCBSync {
- BlockDriverAIOCB common;
- QEMUBH *bh;
- int ret;
-} BlockDriverAIOCBSync;
-
-static BlockDriverAIOCBSync *free_acb = NULL;
-
static void bdrv_aio_bh_cb(void *opaque)
{
BlockDriverAIOCBSync *acb = opaque;