On 05/23/2016 06:54 AM, Paolo Bonzini wrote:
> 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 <pbonz...@redhat.com>
> ---
>  dma-helpers.c        | 48 +++++++++++++++++++++++++++++++++++-------------
>  hw/ide/core.c        | 14 ++++++++------
>  hw/ide/internal.h    |  6 +++---
>  hw/ide/macio.c       |  2 +-
>  include/sysemu/dma.h | 12 ++++++------
>  5 files changed, 53 insertions(+), 29 deletions(-)
> 

Reviewed-by: Eric Blake <ebl...@redhat.com>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to