From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws6m0-00048P-0c for qemu-devel@nongnu.org; Wed, 04 Jun 2014 04:42:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ws6lt-0008A4-Sq for qemu-devel@nongnu.org; Wed, 04 Jun 2014 04:42:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31480) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ws6lt-00088l-L8 for qemu-devel@nongnu.org; Wed, 04 Jun 2014 04:42:09 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s548g8wL028835 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 4 Jun 2014 04:42:08 -0400 Message-ID: <538EDBDC.2060701@redhat.com> Date: Wed, 04 Jun 2014 10:42:04 +0200 From: Paolo Bonzini MIME-Version: 1.0 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> In-Reply-To: <20140604075354.GC3223@T430.nay.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Fam Zheng Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi 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. Paolo