Received: from eggs.gnu.org ([2001:4830:134:3::10]:54022) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpzVj-0004nE-HA for qemu-devel@nongnu.org; Fri, 30 Sep 2016 11:14:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpzVd-0004yx-B0 for qemu-devel@nongnu.org; Fri, 30 Sep 2016 11:14:02 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55362 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpzVd-0004yc-2w for qemu-devel@nongnu.org; Fri, 30 Sep 2016 11:13:57 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8UFDQv7095801 for ; Fri, 30 Sep 2016 11:13:56 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0b-001b2d01.pphosted.com with ESMTP id 25squuqrbd-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 30 Sep 2016 11:13: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 ; Fri, 30 Sep 2016 09:13:55 -0600 From: Greg Kurz Date: Fri, 30 Sep 2016 17:13:48 +0200 In-Reply-To: <147524835229.953.16853431367911587573.stgit@bahia> References: <147524835229.953.16853431367911587573.stgit@bahia> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <147524842846.953.6193727016568885478.stgit@bahia> Subject: [Qemu-devel] [PATCH v4 9/9] virtio-scsi: handle virtio_scsi_set_config() 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 Reviewed-by: Stefan Hajnoczi --- v4: - added Stefan's R-b tag --- hw/scsi/virtio-scsi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index b58de956b684..6eaadd8d7c7d 100644 --- a/hw/scsi/virtio-scsi.c +++ b/hw/scsi/virtio-scsi.c @@ -644,8 +644,9 @@ static void virtio_scsi_set_config(VirtIODevice *vdev, if ((uint32_t) virtio_ldl_p(vdev, &scsiconf->sense_size) >= 65536 || (uint32_t) virtio_ldl_p(vdev, &scsiconf->cdb_size) >= 256) { - error_report("bad data written to virtio-scsi configuration space"); - exit(1); + virtio_error(vdev, + "bad data written to virtio-scsi configuration space"); + return; } vs->sense_size = virtio_ldl_p(vdev, &scsiconf->sense_size);