From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36865) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymj5W-0005v3-Hg for qemu-devel@nongnu.org; Mon, 27 Apr 2015 09:28:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ymj5S-0007mw-E5 for qemu-devel@nongnu.org; Mon, 27 Apr 2015 09:28:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58132) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymj5S-0007ma-90 for qemu-devel@nongnu.org; Mon, 27 Apr 2015 09:28:38 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id D4608AC7B2 for ; Mon, 27 Apr 2015 13:28:37 +0000 (UTC) Message-ID: <553E3982.2030702@redhat.com> Date: Mon, 27 Apr 2015 15:28:34 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1430137765-13771-1-git-send-email-pbonzini@redhat.com> <20150427152255-mutt-send-email-mst@redhat.com> In-Reply-To: <20150427152255-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio-scsi: fix "written length" field in the used ring List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org On 27/04/2015 15:23, Michael S. Tsirkin wrote: > On Mon, Apr 27, 2015 at 02:29:25PM +0200, Paolo Bonzini wrote: >> > qsgl->size is the size of the data field after the request or >> > response header (virtio-scsi currently supports only one such >> > field; bidirectional requests are not supported). However, >> > the used ring's len field is not concerned about the field >> > after the request header, so do not count it unless req->mode >> > signals the request was a read. >> > >> > Also, do not report that anything was written if the request >> > failed, and subtract any residual bytes in case of buffer underrun. >> > >> > Signed-off-by: Paolo Bonzini > Acked-by: Michael S. Tsirkin > > Pls merge through the storage tree. Ok, I'll take it through the SCSI tree then. > Also, can you pls fix up blk similarly? Because virtio-blk uses a response footer and virtio-scsi uses a response header, fixing virtio-blk is much harder. You need to add a new argument to virtqueue_push. I'd really prefer someone else to do it... Paolo