aboutsummaryrefslogtreecommitdiff
path: root/dma-helpers.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-05-23 14:54:05 +0200
committerKevin Wolf <kwolf@redhat.com>2016-05-25 19:04:11 +0200
commitcbe0ed6247a0589e4f72b25984b8afcfa9c26b1c (patch)
treea88e070cee3cc9ca866178ecf41bcedc6591a579 /dma-helpers.c
parent20018e12cfde4847a0e90f0f9942804c20c14894 (diff)
dma-helpers: change interface to byte-based
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'dma-helpers.c')
-rw-r--r--dma-helpers.c14
1 files changed, 7 insertions, 7 deletions
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);
}