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

Reply via email to