From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7PZa-0005Dx-77 for qemu-devel@nongnu.org; Tue, 13 Mar 2012 07:07:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7PZ9-0001Gj-2e for qemu-devel@nongnu.org; Tue, 13 Mar 2012 07:07:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7PZ8-0001GW-R1 for qemu-devel@nongnu.org; Tue, 13 Mar 2012 07:06:54 -0400 Message-ID: <4F5F2B21.90403@redhat.com> Date: Tue, 13 Mar 2012 12:10:25 +0100 From: Kevin Wolf MIME-Version: 1.0 References: <1331579663-29950-1-git-send-email-mjt@msgid.tls.msk.ru> <1331579663-29950-4-git-send-email-mjt@msgid.tls.msk.ru> In-Reply-To: <1331579663-29950-4-git-send-email-mjt@msgid.tls.msk.ru> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCHv3 3/9] allow qemu_iovec_from_buffer() to specify offset from which to start copying List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev Cc: Paolo Bonzini , qemu-devel@nongnu.org Am 12.03.2012 20:14, schrieb Michael Tokarev: > Similar to > qemu_iovec_memset(QEMUIOVector *qiov, size_t offset, > int c, size_t bytes); > the new prototype is: > qemu_iovec_from_buf(QEMUIOVector *qiov, size_t offset, > const void *buf, size_t bytes); > > The processing starts at offset bytes within qiov. > > This way, we may copy a bounce buffer directly to > a middle of qiov. > > This is exactly the same function as iov_from_buf() from > iov.c, so use the existing implementation and rename it > to qemu_iovec_from_buf() to be shorter and to match the > utility function. > > As with utility implementation, we now assert that the > offset is inside actual iovec. Nothing changed for > current callers, because `offset' parameter is new. > > While at it, stop using "bounce-qiov" in block/qcow2.c > and copy decrypted data directly from cluster_data > instead of recreating a temp qiov for doing that > (Cc'ing kwolf for this change). Looks good to me. Kevin