From cbe0ed6247a0589e4f72b25984b8afcfa9c26b1c Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 23 May 2016 14:54:05 +0200 Subject: dma-helpers: change interface to byte-based Signed-off-by: Paolo Bonzini Signed-off-by: Kevin Wolf --- dma-helpers.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'dma-helpers.c') diff --git a/dma-helpers.c b/dma-helpers.c index a6cc15f534..af07aabb81 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -192,18 +192,18 @@ static const AIOCBInfo dma_aiocb_info = { }; BlockAIOCB *dma_blk_io( - BlockBackend *blk, QEMUSGList *sg, uint64_t sector_num, + BlockBackend *blk, QEMUSGList *sg, uint64_t offset, DMAIOFunc *io_func, BlockCompletionFunc *cb, void *opaque, DMADirection dir) { DMAAIOCB *dbs = blk_aio_get(&dma_aiocb_info, blk, cb, opaque); - trace_dma_blk_io(dbs, blk, sector_num, (dir == DMA_DIRECTION_TO_DEVICE)); + trace_dma_blk_io(dbs, blk, offset, (dir == DMA_DIRECTION_TO_DEVICE)); dbs->acb = NULL; dbs->blk = blk; dbs->sg = sg; - dbs->offset = sector_num << BDRV_SECTOR_BITS; + dbs->offset = offset; dbs->sg_cur_index = 0; dbs->sg_cur_byte = 0; dbs->dir = dir; @@ -216,18 +216,18 @@ BlockAIOCB *dma_blk_io( BlockAIOCB *dma_blk_read(BlockBackend *blk, - QEMUSGList *sg, uint64_t sector, + QEMUSGList *sg, uint64_t offset, void (*cb)(void *opaque, int ret), void *opaque) { - return dma_blk_io(blk, sg, sector, blk_aio_preadv, cb, opaque, + return dma_blk_io(blk, sg, offset, blk_aio_preadv, cb, opaque, DMA_DIRECTION_FROM_DEVICE); } BlockAIOCB *dma_blk_write(BlockBackend *blk, - QEMUSGList *sg, uint64_t sector, + QEMUSGList *sg, uint64_t offset, void (*cb)(void *opaque, int ret), void *opaque) { - return dma_blk_io(blk, sg, sector, blk_aio_pwritev, cb, opaque, + return dma_blk_io(blk, sg, offset, blk_aio_pwritev, cb, opaque, DMA_DIRECTION_TO_DEVICE); } -- cgit v1.2.1