Received: from eggs.gnu.org ([2001:4830:134:3::10]:52793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b56PZ-0007WB-S6 for qemu-devel@nongnu.org; Tue, 24 May 2016 03:05:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b56PX-00025O-Pq for qemu-devel@nongnu.org; Tue, 24 May 2016 03:05:52 -0400 Sender: Paolo Bonzini References: <1464008051-6429-1-git-send-email-pbonzini@redhat.com> <1464008051-6429-3-git-send-email-pbonzini@redhat.com> <20160524024709.GF14601@ad.usersys.redhat.com> From: Paolo Bonzini Message-ID: <993172b3-095b-eaec-bfb9-5d9b0157f62a@redhat.com> Date: Tue, 24 May 2016 09:05:40 +0200 MIME-Version: 1.0 In-Reply-To: <20160524024709.GF14601@ad.usersys.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/7] dma-helpers: change BlockBackend to opaque value in DMAIOFunc List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org 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