From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:51678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrQ9I-0001Ql-6S for qemu-devel@nongnu.org; Thu, 11 Aug 2011 03:57:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QrQ9H-0000KG-4a for qemu-devel@nongnu.org; Thu, 11 Aug 2011 03:57:52 -0400 Received: from mail-fx0-f45.google.com ([209.85.161.45]:48570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrQ9G-0000K8-Tp for qemu-devel@nongnu.org; Thu, 11 Aug 2011 03:57:51 -0400 Received: by fxbb27 with SMTP id b27so1724180fxb.4 for ; Thu, 11 Aug 2011 00:57:49 -0700 (PDT) Date: Thu, 11 Aug 2011 08:57:40 +0100 From: Stefan Hajnoczi Message-ID: <20110811075740.GA29542@stefanha-thinkpad.localdomain> References: <1312478089-806-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1312478089-806-1-git-send-email-pbonzini@redhat.com> Subject: Re: [Qemu-devel] [PATCH 00/10] SCSI scatter/gather support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org On Thu, Aug 04, 2011 at 07:14:38PM +0200, Paolo Bonzini wrote: > Hi, > > this is the version of SCSI scatter/gather based on the existing > DMA helpers infrastructure. > > The infrastructure required a little update because I need to > know the residual amount of data upon short transfers. To this > end, my choice was to make QEMUSGList mutable and track the > current position in there. Any other ideas are welcome, the > reason for this choice is explained in patch 2. > > The patches are quite self-contained, but they depend on the > changes I posted yesterday. > > Patch 11 is the sample vmw_pvscsi device model that I used to > test the code. This is a good opportunity to rename is_write in dma-helpers because it is confusing. The problem is that bdrv_*() is_write indicates whether the I/O request is a read or write. But in cpu_physical_memory_map() is_write indicates whether we are writing to target memory. These two is_write use cases actually have opposite meanings, therefore the confusing code in dma-helpers.c today: mem = cpu_physical_memory_map(cur_addr, &cur_len, !dbs->is_write); ^^^^^^^^^^^^^^ Please use a DMA direction instead of is_write: DMA-to-device means target->device memory transfer DMA-from-device means device->target memory transfer This patch series is a good place to do the rename because it adds more instances of !dbs->is_write. Stefan