]> Git Repo - qemu.git/commit
virtio-blk: handle virtio_blk_handle_request() errors
authorGreg Kurz <[email protected]>
Fri, 30 Sep 2016 15:13:07 +0000 (17:13 +0200)
committerMichael S. Tsirkin <[email protected]>
Sun, 9 Oct 2016 22:16:59 +0000 (01:16 +0300)
commit20ea686a0cacdec1bde9a39e74afd38bf672424d
tree7932a023d98f87301b5412d480e15ae63cdbad85
parentd3d74d6fe095e2e49d030e0c163cecfb9c20f1d4
virtio-blk: handle virtio_blk_handle_request() errors

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 <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
hw/block/virtio-blk.c
This page took 0.022724 seconds and 4 git commands to generate.