From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn4J6-0004ef-5t for qemu-devel@nongnu.org; Thu, 22 Sep 2016 09:44:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn4J2-0007oV-64 for qemu-devel@nongnu.org; Thu, 22 Sep 2016 09:44:56 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:48563 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn4J1-0007oM-Vk for qemu-devel@nongnu.org; Thu, 22 Sep 2016 09:44:52 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8MDgvPH134950 for ; Thu, 22 Sep 2016 09:44:51 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0b-001b2d01.pphosted.com with ESMTP id 25m9p1npdn-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 22 Sep 2016 09:44:51 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 22 Sep 2016 14:44:49 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 3D64917D805A for ; Thu, 22 Sep 2016 14:46:47 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u8MDilm88716682 for ; Thu, 22 Sep 2016 13:44:47 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u8MDilDk026949 for ; Thu, 22 Sep 2016 07:44:47 -0600 Date: Thu, 22 Sep 2016 15:44:44 +0200 From: Cornelia Huck In-Reply-To: <147447704092.30952.7983028961569052217.stgit@bahia> References: <147447700612.30952.9420141963781948805.stgit@bahia> <147447704092.30952.7983028961569052217.stgit@bahia> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160922154444.560c7d45.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH v2 4/9] virtio-blk: handle virtio_blk_handle_request() errors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: qemu-devel@nongnu.org, Kevin Wolf , "Michael S. Tsirkin" , Jason Wang , Max Reitz , "Aneesh Kumar K.V" , Stefan Hajnoczi , Paolo Bonzini On Wed, 21 Sep 2016 18:57:20 +0200 Greg Kurz wrote: > All these errors are caused by a buggy guest: let's switch the device to > the broken state instead of terminating QEMU. > > Signed-off-by: Greg Kurz > --- > v2: - added a out_err: label in virtio_blk_handle_vq() > --- > hw/block/virtio-blk.c | 28 ++++++++++++++++++---------- > 1 file changed, 18 insertions(+), 10 deletions(-) > > @@ -586,13 +589,16 @@ void virtio_blk_handle_vq(VirtIOBlock *s, VirtQueue *vq) > blk_io_plug(s->blk); > > while ((req = virtio_blk_get_request(s, vq))) { > - virtio_blk_handle_request(req, &mrb); > + if (virtio_blk_handle_request(req, &mrb)) { > + goto out_err; > + } > } > > if (mrb.num_reqs) { > virtio_blk_submit_multireq(s->blk, &mrb); > } > > +out_err: I would probably have called that label out_unplug instead, but still Reviewed-by: Cornelia Huck > blk_io_unplug(s->blk); > } >