提交 90765429 编写于 作者: B bellard

fixed aio emulation


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2099 c046a42c-6fe2-441c-8c8c-71466251a162
上级 ce1a14dc
...@@ -35,6 +35,12 @@ ...@@ -35,6 +35,12 @@
#define SECTOR_BITS 9 #define SECTOR_BITS 9
#define SECTOR_SIZE (1 << SECTOR_BITS) #define SECTOR_SIZE (1 << SECTOR_BITS)
typedef struct BlockDriverAIOCBSync {
BlockDriverAIOCB common;
QEMUBH *bh;
int ret;
} BlockDriverAIOCBSync;
static BlockDriverAIOCB *bdrv_aio_read_em(BlockDriverState *bs, static BlockDriverAIOCB *bdrv_aio_read_em(BlockDriverState *bs,
int64_t sector_num, uint8_t *buf, int nb_sectors, int64_t sector_num, uint8_t *buf, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque); BlockDriverCompletionFunc *cb, void *opaque);
...@@ -111,6 +117,7 @@ void bdrv_register(BlockDriver *bdrv) ...@@ -111,6 +117,7 @@ void bdrv_register(BlockDriver *bdrv)
bdrv->bdrv_aio_read = bdrv_aio_read_em; bdrv->bdrv_aio_read = bdrv_aio_read_em;
bdrv->bdrv_aio_write = bdrv_aio_write_em; bdrv->bdrv_aio_write = bdrv_aio_write_em;
bdrv->bdrv_aio_cancel = bdrv_aio_cancel_em; bdrv->bdrv_aio_cancel = bdrv_aio_cancel_em;
bdrv->aiocb_size = sizeof(BlockDriverAIOCBSync);
} else if (!bdrv->bdrv_read && !bdrv->bdrv_pread) { } else if (!bdrv->bdrv_read && !bdrv->bdrv_pread) {
/* add synchronous IO emulation layer */ /* add synchronous IO emulation layer */
bdrv->bdrv_read = bdrv_read_em; bdrv->bdrv_read = bdrv_read_em;
...@@ -1061,14 +1068,6 @@ static void bdrv_aio_cancel_em(BlockDriverAIOCB *acb) ...@@ -1061,14 +1068,6 @@ static void bdrv_aio_cancel_em(BlockDriverAIOCB *acb)
{ {
} }
#else #else
typedef struct BlockDriverAIOCBSync {
BlockDriverAIOCB common;
QEMUBH *bh;
int ret;
} BlockDriverAIOCBSync;
static BlockDriverAIOCBSync *free_acb = NULL;
static void bdrv_aio_bh_cb(void *opaque) static void bdrv_aio_bh_cb(void *opaque)
{ {
BlockDriverAIOCBSync *acb = opaque; BlockDriverAIOCBSync *acb = opaque;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册