From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYD9X-0000UB-DC for qemu-devel@nongnu.org; Wed, 18 Mar 2015 08:32:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYD9T-0001PO-Dl for qemu-devel@nongnu.org; Wed, 18 Mar 2015 08:32:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYD9T-0001PI-8n for qemu-devel@nongnu.org; Wed, 18 Mar 2015 08:32:47 -0400 Date: Wed, 18 Mar 2015 13:32:44 +0100 From: "Michael S. Tsirkin" Message-ID: <20150318133149-mutt-send-email-mst@redhat.com> References: <1426053572-21326-1-git-send-email-rusty@rustcorp.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426053572-21326-1-git-send-email-rusty@rustcorp.com.au> Subject: Re: [Qemu-devel] [PATCH 0/2] virtio len fixes for qemu. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rusty Russell Cc: QEMU Developers On Wed, Mar 11, 2015 at 04:29:30PM +1030, Rusty Russell wrote: > The virtio 'used' ring describes descriptors which have been used. It > also says how many bytes have been written to the ring. For some cases, > this value is ignored by Linux guests, thus errors have not been noticed. > I was working on increasing the checking in Linux when I noticed this > behaviour. > > The first patch changes the 'len' formal parameter name to 'len_written' to > make the API clearer, and adds an assert(). The second fixes block writes. > > Cheers, > Rusty. > PS. It's based on MST's virtio-1.0 tree, but should be easily ported. After going back and forth on this, I decided it's best to defer this change to 2.4. Guests can't depend on this behaviour without checking virtio-1 anyway. > Rusty Russell (2): > virtio: make it clear that "len" for a used descriptor is len written. > virtio-blk: fix length calculations for write operations. > > hw/block/virtio-blk.c | 9 ++++++++- > hw/virtio/virtio.c | 19 ++++++++++++------- > include/hw/virtio/virtio.h | 4 ++-- > 3 files changed, 22 insertions(+), 10 deletions(-) > > -- > 2.1.0