qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 4/9] virtio-blk: handle virtio_blk_handle_req


From: Cornelia Huck
Subject: Re: [Qemu-devel] [PATCH v2 4/9] virtio-blk: handle virtio_blk_handle_request() errors
Date: Thu, 22 Sep 2016 15:44:44 +0200

On Wed, 21 Sep 2016 18:57:20 +0200
Greg Kurz <address@hidden> 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 <address@hidden>
> ---
> 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 <address@hidden>

>      blk_io_unplug(s->blk);
>  }
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]