[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 4/9] virtio-blk: handle virtio_blk_handle_req
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v3 4/9] virtio-blk: handle virtio_blk_handle_request() errors |
Date: |
Mon, 26 Sep 2016 17:24:47 +0100 |
User-agent: |
Mutt/1.7.0 (2016-08-17) |
On Mon, Sep 26, 2016 at 10:34:24AM +0200, Greg Kurz wrote:
> All these errors are caused by a buggy guest: QEMU should not exit.
>
> With this patch, if virtio_blk_handle_request() detects a buggy request, it
> marks the device as broken and returns an error to the caller so it takes
> appropriate action.
>
> In the case of virtio_blk_handle_vq(), we detach the request from the
> virtqueue, free its allocated memory and stop popping new requests.
> We don't need to bother about multireq since virtio_blk_handle_request()
> errors out early and mrb.num_reqs == 0.
>
> In the case of virtio_blk_dma_restart_bh(), we need to detach and free all
> queued requests as well.
>
> Signed-off-by: Greg Kurz <address@hidden>
> ---
> v3: - turned goto out_err to break in virtio_blk_handle_vq()
> - detach and free request in virtio_blk_handle_vq()
> - detach and free all queued requests in virtio_blk_dma_restart_bh()
> - updated changelog
> ---
> hw/block/virtio-blk.c | 38 ++++++++++++++++++++++++++++----------
> 1 file changed, 28 insertions(+), 10 deletions(-)
Reviewed-by: Stefan Hajnoczi <address@hidden>
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH v3 0/9] virtio: avoid inappropriate QEMU termination, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 1/9] virtio-9p: add parentheses to sizeof operator, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 2/9] virtio-blk: make some functions static, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 3/9] virtio-9p: handle handle_9p_output() error, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 4/9] virtio-blk: handle virtio_blk_handle_request() errors, Greg Kurz, 2016/09/26
- Re: [Qemu-devel] [PATCH v3 4/9] virtio-blk: handle virtio_blk_handle_request() errors,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v3 5/9] virtio-net: handle virtio_net_handle_ctrl() error, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 6/9] virtio-net: handle virtio_net_receive() errors, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 7/9] virtio-net: handle virtio_net_flush_tx() errors, Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 8/9] virtio-scsi: convert virtio_scsi_bad_req() to use virtio_error(), Greg Kurz, 2016/09/26
- [Qemu-devel] [PATCH v3 9/9] virtio-scsi: handle virtio_scsi_set_config() error, Greg Kurz, 2016/09/26