Received: from eggs.gnu.org ([2001:4830:134:3::10]:53717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmiX5-0000mp-4i for qemu-devel@nongnu.org; Wed, 21 Sep 2016 10:29:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmiX0-00079f-4H for qemu-devel@nongnu.org; Wed, 21 Sep 2016 10:29:55 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmiWz-00079J-S5 for qemu-devel@nongnu.org; Wed, 21 Sep 2016 10:29:50 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u8LETUcT090358 for ; Wed, 21 Sep 2016 10:29:49 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 25kmfdmwey-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 21 Sep 2016 10:29:38 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Sep 2016 15:28:39 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id B08EF17D805D for ; Wed, 21 Sep 2016 15:30:36 +0100 (BST) Received: from d06av04.portsmouth.uk.ibm.com (d06av04.portsmouth.uk.ibm.com [9.149.37.216]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u8LESbgj13435208 for ; Wed, 21 Sep 2016 14:28:37 GMT Received: from d06av04.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av04.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u8LESaOp014702 for ; Wed, 21 Sep 2016 08:28:37 -0600 Date: Wed, 21 Sep 2016 16:28:34 +0200 From: Cornelia Huck In-Reply-To: <147446364924.4880.15558748866518264841.stgit@bahia> References: <147446363181.4880.18104448248886932114.stgit@bahia> <147446364924.4880.15558748866518264841.stgit@bahia> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160921162834.170a794f.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH 2/7] 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 15:14:09 +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 > --- > hw/block/virtio-blk.c | 27 +++++++++++++++++---------- > 1 file changed, 17 insertions(+), 10 deletions(-) > > diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c > index 3a6112fbf4c4..1285d196a40f 100644 > --- a/hw/block/virtio-blk.c > +++ b/hw/block/virtio-blk.c > @@ -468,30 +468,32 @@ static bool virtio_blk_sect_range_ok(VirtIOBlock *dev, > return true; > } > > -void virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb) > +int virtio_blk_handle_request(VirtIOBlockReq *req, MultiReqBuffer *mrb) Unrelated to your patch: It seems there are no callers (left) outside of this file; should the function be made static? Related to your patch: You didn't change the prototype in the header :) (...) > @@ -586,7 +589,9 @@ 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)) { > + return; Does the missing blk_io_unplug() have any side-effects outside of this device, which is broken anyway? > + } > } > > if (mrb.num_reqs) {