path: root/dma.h
diff options
authorChristoph Hellwig <hch@lst.de>2011-05-19 10:57:59 +0200
committerKevin Wolf <kwolf@redhat.com>2011-06-15 14:36:16 +0200
commitcb144ccb2ffdb3bca4026455074e434d8db34d73 (patch)
tree550622a24052ea59e64e3efd7486201b29956af9 /dma.h
parent0754f9ecef98ad95442f16657df9721dd5682c3a (diff)
make dma_bdrv_io available to drivers
Make dma_bdrv_io available for drivers, and pass an explicit I/O function instead of hardcoding bdrv_aio_readv/bdrv_aio_writev. This is required to implement non-READ/WRITE dma commands in the ide driver, e.g. the upcoming TRIM support. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'dma.h')
1 files changed, 8 insertions, 0 deletions
diff --git a/dma.h b/dma.h
index f3bb27515..3d8324bb5 100644
--- a/dma.h
+++ b/dma.h
@@ -32,6 +32,14 @@ void qemu_sglist_add(QEMUSGList *qsg, target_phys_addr_t base,
target_phys_addr_t len);
void qemu_sglist_destroy(QEMUSGList *qsg);
+typedef BlockDriverAIOCB *DMAIOFunc(BlockDriverState *bs, int64_t sector_num,
+ QEMUIOVector *iov, int nb_sectors,
+ BlockDriverCompletionFunc *cb, void *opaque);
+BlockDriverAIOCB *dma_bdrv_io(BlockDriverState *bs,
+ QEMUSGList *sg, uint64_t sector_num,
+ DMAIOFunc *io_func, BlockDriverCompletionFunc *cb,
+ void *opaque, int is_write);
BlockDriverAIOCB *dma_bdrv_read(BlockDriverState *bs,
QEMUSGList *sg, uint64_t sector,
BlockDriverCompletionFunc *cb, void *opaque);