[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 2/7] dma-helpers: change BlockBackend to opaque

From: Paolo Bonzini
Subject: Re: [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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]