From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60334) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmJTz-00007j-Os for qemu-devel@nongnu.org; Tue, 20 Sep 2016 07:45:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmJTv-0005gH-KG for qemu-devel@nongnu.org; Tue, 20 Sep 2016 07:45:03 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmJTv-0005fz-CA for qemu-devel@nongnu.org; Tue, 20 Sep 2016 07:44:59 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8KBgxln033648 for ; Tue, 20 Sep 2016 07:44:58 -0400 Received: from e06smtp08.uk.ibm.com (e06smtp08.uk.ibm.com [195.75.94.104]) by mx0a-001b2d01.pphosted.com with ESMTP id 25k0w3bbf1-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Tue, 20 Sep 2016 07:44:58 -0400 Received: from localhost by e06smtp08.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 20 Sep 2016 12:44:55 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id D3EF01B08061 for ; Tue, 20 Sep 2016 12:46:45 +0100 (BST) Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u8KBisYW14942694 for ; Tue, 20 Sep 2016 11:44:54 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u8KBisb0031664 for ; Tue, 20 Sep 2016 05:44:54 -0600 Date: Tue, 20 Sep 2016 13:44:52 +0200 From: Cornelia Huck In-Reply-To: <1460467534-29147-7-git-send-email-stefanha@redhat.com> References: <1460467534-29147-1-git-send-email-stefanha@redhat.com> <1460467534-29147-7-git-send-email-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160920134452.2c822361.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH v3 06/10] virtio: handle virtqueue_get_avail_bytes() errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Fam Zheng On Tue, 12 Apr 2016 14:25:30 +0100 Stefan Hajnoczi wrote: > If the vring is invalid, tell the caller no bytes are available and mark > the device broken. > > Signed-off-by: Stefan Hajnoczi > --- > hw/virtio/virtio.c | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) > > @@ -449,6 +449,11 @@ done: > if (out_bytes) { > *out_bytes = out_total; > } > + return; > + > +err: > + in_total = out_total = 0; > + goto done; This jumping around looks a bit weird, but I don't have any better idea. > } > > int virtqueue_avail_bytes(VirtQueue *vq, unsigned int in_bytes, Reviewed-by: Cornelia Huck