From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws8yO-0002vj-0q for qemu-devel@nongnu.org; Wed, 04 Jun 2014 07:03:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ws8yG-00077A-HY for qemu-devel@nongnu.org; Wed, 04 Jun 2014 07:03:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18328) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws8yG-000770-9e for qemu-devel@nongnu.org; Wed, 04 Jun 2014 07:03:04 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s54B33A2017401 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 4 Jun 2014 07:03:03 -0400 Date: Wed, 4 Jun 2014 19:03:16 +0800 From: Fam Zheng Message-ID: <20140604110316.GD3223@T430.nay.redhat.com> References: <1401799978-9558-1-git-send-email-famz@redhat.com> <1401799978-9558-6-git-send-email-famz@redhat.com> <538DCF99.9030602@redhat.com> <20140604075354.GC3223@T430.nay.redhat.com> <538EDBDC.2060701@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <538EDBDC.2060701@redhat.com> Subject: Re: [Qemu-devel] [PATCH 5/5] virtio-blk: Drop VirtIOBlockReq.read List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi On Wed, 06/04 10:42, Paolo Bonzini wrote: > Il 04/06/2014 09:53, Fam Zheng ha scritto: > >>> For the sake of restarting requests, we also need dataplane to populate the > >>> "out" field for dataplane. We can also take the occasion to change it from > >>> "struct virtio_blk_outhdr *" to "struct virtio_blk_outhdr" for non-dataplane > >>> and use iov_discard_front on the elem (see dataplane's process_request > >>> function). > >Using pointer avoids copying, what's the advantage of converting to "sturct > >virtio_blk_outhdr" for non-dataplane code? For thread-safety? > > The virtio code currently assumes that the outhdr is in its own iovec. This > is not guaranteed by the spec, it's just that the drivers do it because QEMU > required it. > I see, thanks. Will convert it. IIUC, this also applies to inhdr? Do we need to fix them as well? Fam