[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH 2/7] dma-helpers: change BlockBacke
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH 2/7] dma-helpers: change BlockBackend to opaque value in DMAIOFunc |
Date: |
Tue, 24 May 2016 09:05:40 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.0 |
On 24/05/2016 04:47, Fam Zheng wrote:
> > -typedef BlockAIOCB *DMAIOFunc(BlockBackend *blk, int64_t offset,
> > - QEMUIOVector *iov, BdrvRequestFlags flags,
> > - BlockCompletionFunc *cb, void *opaque);
>
> Wasn't flags parameter added for a reason in d4f510eb3f? Would it be useful
> for
> things like offloading FUA?
It was added only to give DMAIOFunc the same prototype as
blk_aio_p{read,write}v. This is not useful anymore.
In the case of scsi-disk, the flags argument is not useful for
offloading FUA. Instead, the DMAIOFunc will look into the opaque
argument (a SCSIDiskReq) and build the flags argument from there.
In the case of dma_aio_readv/writev, if you want to add a flags argument
you'll have to build a
struct DMAAioData {
BlockBackend *blk;
BdrvRequestFlags flags;
}
and pass it as the opaque argument.
Thanks,
Paolo
- [Qemu-block] [PATCH v2 0/7] dma-helpers, scsi-block: use SG_IO for all I/O on scsi-block, Paolo Bonzini, 2016/05/23
- [Qemu-block] [PATCH 2/7] dma-helpers: change BlockBackend to opaque value in DMAIOFunc, Paolo Bonzini, 2016/05/23
- [Qemu-block] [PATCH 5/7] scsi-disk: add need_fua_emulation to SCSIDiskClass, Paolo Bonzini, 2016/05/23
- [Qemu-block] [PATCH 1/7] dma-helpers: change interface to byte-based, Paolo Bonzini, 2016/05/23
- [Qemu-block] [PATCH 3/7] scsi-disk: introduce a common base class, Paolo Bonzini, 2016/05/23
- [Qemu-block] [PATCH 4/7] scsi-disk: introduce dma_readv and dma_writev, Paolo Bonzini, 2016/05/23