From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45343) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymjdn-0000oY-Nl for qemu-devel@nongnu.org; Mon, 27 Apr 2015 10:04:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ymjdj-0007YP-KI for qemu-devel@nongnu.org; Mon, 27 Apr 2015 10:04:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymjdj-0007Y6-Ct for qemu-devel@nongnu.org; Mon, 27 Apr 2015 10:04:03 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3RE42qT002479 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 27 Apr 2015 10:04:02 -0400 Date: Mon, 27 Apr 2015 16:04:00 +0200 From: "Michael S. Tsirkin" Message-ID: <20150427160216-mutt-send-email-mst@redhat.com> References: <1430137765-13771-1-git-send-email-pbonzini@redhat.com> <20150427152255-mutt-send-email-mst@redhat.com> <553E3982.2030702@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <553E3982.2030702@redhat.com> 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: Paolo Bonzini Cc: qemu-devel@nongnu.org On Mon, Apr 27, 2015 at 03:28:34PM +0200, Paolo Bonzini wrote: > > > 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 OK but what's the desired API? Do you know the host length or might any part of iov be dirty? -- MST