Skip to content
Snippets Groups Projects
  • Paolo Bonzini's avatar
    8a8e63eb
    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: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    8a8e63eb
    History
    dma-helpers: change BlockBackend to opaque value in DMAIOFunc
    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: default avatarPaolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>