summary refs log tree commit diff stats
path: root/hw/net/virtio-net.c
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2016-09-30 17:13:07 +0200
committerMichael S. Tsirkin <mst@redhat.com>2016-10-10 01:16:59 +0300
commit20ea686a0cacdec1bde9a39e74afd38bf672424d (patch)
tree7932a023d98f87301b5412d480e15ae63cdbad85 /hw/net/virtio-net.c
parentd3d74d6fe095e2e49d030e0c163cecfb9c20f1d4 (diff)
downloadfocaccia-qemu-20ea686a0cacdec1bde9a39e74afd38bf672424d.tar.gz
focaccia-qemu-20ea686a0cacdec1bde9a39e74afd38bf672424d.zip
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 <groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/net/virtio-net.c')
0 files changed, 0 insertions, 0 deletions