From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZG7z-0006vb-VT for qemu-devel@nongnu.org; Thu, 02 Feb 2017 07:04:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZG7v-0002WA-UZ for qemu-devel@nongnu.org; Thu, 02 Feb 2017 07:04:39 -0500 Date: Thu, 2 Feb 2017 07:04:21 -0500 (EST) From: Paolo Bonzini Message-ID: <1666046970.16239766.1486037061141.JavaMail.zimbra@redhat.com> In-Reply-To: <20170202101758.GC22164@stefanha-x1.localdomain> References: <1485800032-24404-1-git-send-email-hch@lst.de> <1485800032-24404-2-git-send-email-hch@lst.de> <20170201164050.GD12283@stefanha-x1.localdomain> <20170202101758.GC22164@stefanha-x1.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] nvme: implement the DSM command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: Christoph Hellwig , keith busch , qemu-devel@nongnu.org, qemu-block@nongnu.org > On Wed, Feb 01, 2017 at 12:29:22PM -0800, Paolo Bonzini wrote: > > On 01/02/2017 08:40, Stefan Hajnoczi wrote: > > >> + goto out_free_range; > > >> + } > > >> + > > >> + if (dma_buf_write((uint8_t *)range, sizeof(range), &qsg)) { > > > > > > Did you mean sizeof(*range) * nr? > > > > Did you also mean dma_buf_read (you want to read from device to range)? > > uint64_t dma_buf_write(uint8_t *ptr, int32_t len, QEMUSGList *sg) > { > return dma_buf_rw(ptr, len, sg, DMA_DIRECTION_TO_DEVICE); > } > > DMA_DIRECTION_TO_DEVICE seems correct. Yes, it is. Paolo