mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
dma-helpers: change BlockBackend to opaque value in DMAIOFunc
Callers of dma_blk_io have no way to pass extra data to the DMAIOFunc, because the original callback and opaque are gone by the time DMAIOFunc is called. On the other hand, the BlockBackend is usually derived from those extra data that you could pass to the DMAIOFunc (in the next patch, that would be the SCSIRequest). So change DMAIOFunc's prototype, decoupling it from blk_aio_readv and blk_aio_writev's. The new prototype loses the BlockBackend and gains an extra opaque value which, in the case of dma_blk_readv and dma_blk_writev, is of course used for the BlockBackend. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
cbe0ed6247
commit
8a8e63ebdd
5 changed files with 53 additions and 29 deletions
|
@ -230,7 +230,7 @@ static void pmac_dma_trim(BlockBackend *blk,
|
|||
s->io_buffer_index += io->len;
|
||||
io->len = 0;
|
||||
|
||||
s->bus->dma->aiocb = ide_issue_trim(blk, offset, &io->iov, 0, cb, io);
|
||||
s->bus->dma->aiocb = ide_issue_trim(offset, &io->iov, cb, io, blk);
|
||||
}
|
||||
|
||||
static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue