diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-07 18:43:20 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-07 18:43:20 +0000 |
commit | c87c0672936a5b825c0b95bb1d7f5d6dc92294e4 (patch) | |
tree | cd09068e0b107d8ce738868752b613a65d2d229f /hw/ide.c | |
parent | f1b2f712a4f059734b8eaebc0e523061387aeb26 (diff) |
remove bdrv_aio_read/bdrv_aio_write (Christoph Hellwig)
Always use the vectored APIs to reduce code churn once we switch the BlockDriver
API to be vectored.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7019 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ide.c')
-rw-r--r-- | hw/ide.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -496,6 +496,8 @@ typedef struct BMDMAState { IDEState *ide_if; BlockDriverCompletionFunc *dma_cb; BlockDriverAIOCB *aiocb; + struct iovec iov; + QEMUIOVector qiov; int64_t sector_num; uint32_t nsector; } BMDMAState; @@ -1467,9 +1469,11 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret) #ifdef DEBUG_AIO printf("aio_read_cd: lba=%u n=%d\n", s->lba, n); #endif - bm->aiocb = bdrv_aio_read(s->bs, (int64_t)s->lba << 2, - s->io_buffer + data_offset, n * 4, - ide_atapi_cmd_read_dma_cb, bm); + bm->iov.iov_base = s->io_buffer + data_offset; + bm->iov.iov_len = n * 4 * 512; + qemu_iovec_init_external(&bm->qiov, &bm->iov, 1); + bm->aiocb = bdrv_aio_readv(s->bs, (int64_t)s->lba << 2, &bm->qiov, + n * 4, ide_atapi_cmd_read_dma_cb, bm); if (!bm->aiocb) { /* Note: media not present is the most likely case */ ide_atapi_cmd_error(s, SENSE_NOT_READY, |