• Paolo Bonzini's avatar
    dma-helpers: change BlockBackend to opaque value in DMAIOFunc · 8a8e63eb
    Paolo Bonzini authored
    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: 's avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: 's avatarKevin Wolf <kwolf@redhat.com>
dma-helpers.c 7.48 KB