Received: from eggs.gnu.org ([2001:4830:134:3::10]:34541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmhM4-0002OY-UH for qemu-devel@nongnu.org; Wed, 21 Sep 2016 09:14:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmhM1-0007ZV-MI for qemu-devel@nongnu.org; Wed, 21 Sep 2016 09:14:28 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49342 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmhM1-0007ZJ-G0 for qemu-devel@nongnu.org; Wed, 21 Sep 2016 09:14:25 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8LDCabl060658 for ; Wed, 21 Sep 2016 09:14:25 -0400 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0b-001b2d01.pphosted.com with ESMTP id 25khtdfh46-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 21 Sep 2016 09:14:25 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Sep 2016 09:14:24 -0400 From: Greg Kurz Date: Wed, 21 Sep 2016 15:14:17 +0200 In-Reply-To: <147446363181.4880.18104448248886932114.stgit@bahia> References: <147446363181.4880.18104448248886932114.stgit@bahia> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <147446365782.4880.9477223746897679434.stgit@bahia> Subject: [Qemu-devel] [PATCH 3/7] virtio-net: handle virtio_net_handle_ctrl() error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , "Michael S. Tsirkin" , Jason Wang , Greg Kurz , Max Reitz , "Aneesh Kumar K.V" , Stefan Hajnoczi , Cornelia Huck , Paolo Bonzini This error is caused by a buggy guest: let's switch the device to the broken state instead of terminating QEMU. Signed-off-by: Greg Kurz --- hw/net/virtio-net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 01f1351554aa..68a448acd81b 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -892,8 +892,8 @@ static void virtio_net_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) } if (iov_size(elem->in_sg, elem->in_num) < sizeof(status) || iov_size(elem->out_sg, elem->out_num) < sizeof(ctrl)) { - error_report("virtio-net ctrl missing headers"); - exit(1); + virtio_error(vdev, "virtio-net ctrl missing headers"); + return; } iov_cnt = elem->out_num;