]> git.proxmox.com Git - mirror_qemu.git/commit
dma-helpers: change BlockBackend to opaque value in DMAIOFunc
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 23 May 2016 12:54:06 +0000 (14:54 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 25 May 2016 17:04:11 +0000 (19:04 +0200)
commit8a8e63ebdd5a6605af6a9df07c62b2214e1a650c
treea6b6ee512647a71561ededbe29267ca2fa67cb18
parentcbe0ed6247a0589e4f72b25984b8afcfa9c26b1c
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>
dma-helpers.c
hw/ide/core.c
hw/ide/internal.h
hw/ide/macio.c
include/sysemu/dma.h