Received: from eggs.gnu.org ([2001:4830:134:3::10]:39453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmkpR-0005Mb-Bl for qemu-devel@nongnu.org; Wed, 21 Sep 2016 12:57:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmkpN-0002i5-Qf for qemu-devel@nongnu.org; Wed, 21 Sep 2016 12:57:00 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:55990) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmkpN-0002hw-He for qemu-devel@nongnu.org; Wed, 21 Sep 2016 12:56:57 -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 u8LGrRBT091804 for ; Wed, 21 Sep 2016 12:56:56 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 25kta9n6k0-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 21 Sep 2016 12:56:56 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Sep 2016 10:56:54 -0600 From: Greg Kurz Date: Wed, 21 Sep 2016 18:56:46 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <147447700612.30952.9420141963781948805.stgit@bahia> Subject: [Qemu-devel] [PATCH v2 0/9] virtio: avoid inappropriate QEMU termination 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 series is a follow up to Stefan's work to eradicate most calls to exit() we currently have in the virtio code. It addresses all exit() call sites in the blk, net and scsi device code, where the error is about a missing or malformed in/out header sent by the guest. They are converted to use virtio_error() and stop any processing, instead of exiting. The remaining call sites are related to a host misconfiguration or a migration stream issue. The 9P code currently calls assert() instead of exit(), but it also about malformed or missing headers, so it gets converted the same way. Next work will be to check all assert() call sites in the device code, in case some of them actually refer to a bug in the guest, and should be converted to use virtio_error() as well. --- Greg Kurz (9): virtio-9p: add parentheses to sizeof operator virtio-blk: turn virtio_blk_handle_request() into a static function virtio-9p: handle handle_9p_output() error virtio-blk: handle virtio_blk_handle_request() errors virtio-net: handle virtio_net_handle_ctrl() error virtio-net: handle virtio_net_receive() errors virtio-net: handle virtio_net_flush_tx() errors virtio-scsi: convert virtio_scsi_bad_req() to use virtio_error() virtio-scsi: handle virtio_scsi_set_config() error hw/9pfs/virtio-9p-device.c | 24 ++++++++++++++----- hw/block/virtio-blk.c | 28 ++++++++++++++-------- hw/net/virtio-net.c | 51 +++++++++++++++++++++++----------------- hw/scsi/virtio-scsi.c | 23 ++++++++++-------- include/hw/virtio/virtio-blk.h | 2 -- 5 files changed, 78 insertions(+), 50 deletions(-) -- Greg