Received: from eggs.gnu.org ([2001:4830:134:3::10]:49879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YmjuC-0007eA-3E for qemu-devel@nongnu.org; Mon, 27 Apr 2015 10:21:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ymju8-0005mg-V3 for qemu-devel@nongnu.org; Mon, 27 Apr 2015 10:21:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ymju8-0005mT-OZ for qemu-devel@nongnu.org; Mon, 27 Apr 2015 10:21:00 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3REL0Ow027120 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 27 Apr 2015 10:21:00 -0400 Date: Mon, 27 Apr 2015 16:20:57 +0200 From: "Michael S. Tsirkin" Message-ID: <20150427161951-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> <20150427160216-mutt-send-email-mst@redhat.com> <553E4543.9080700@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <553E4543.9080700@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 04:18:43PM +0200, Paolo Bonzini wrote: > > > On 27/04/2015 16:04, Michael S. Tsirkin wrote: > >> > 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? > > For a 1-sector request and a 2048+1 bytes iov, I know that I've written > bytes 0-511 and byte 2048. > > So I have to dirty all 2049 bytes, but the written length should be 512. > Right now we pass 2049 to virtqueue_push and write 2049 to the written > length, I'd need another argument to pass the 512. > > Paolo OK, I sent a patch with a new API, pls take a look. Can you implement your patch on top?