qemu/hw/block
Greg Kurz 20ea686a0c 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>
2016-10-10 01:16:59 +03:00
..
dataplane virtio-blk: dataplane cleanup 2016-07-18 15:10:52 +01:00
block.c block/qdev: Allow configuring rerror/werror with qdev properties 2016-07-13 13:32:27 +02:00
cdrom.c block: Clean up includes 2016-01-20 13:36:23 +01:00
ecc.c block: Clean up includes 2016-01-20 13:36:23 +01:00
fdc.c portio: keep references on portio 2016-09-08 18:05:21 +04:00
hd-geometry.c qemu-common: stop including qemu/bswap.h from qemu-common.h 2016-05-19 16:42:28 +02:00
m25p80.c block: m25p80: Fix vmstate structure name 2016-09-06 19:52:18 +01:00
Makefile.objs block: Always compile virtio-blk dataplane 2014-09-22 11:39:51 +01:00
nand.c nand: Switch to byte-based block access 2016-05-12 15:22:09 +02:00
nvme.c nvme: bump PCI revision 2016-08-05 10:56:08 +02:00
nvme.h util: move declarations out of qemu-common.h 2016-03-22 22:20:17 +01:00
onenand.c onenand: Switch to byte-based block access 2016-05-12 15:22:09 +02:00
pflash_cfi01.c pflash: make TYPE_CFI_PFLASH0{1,2} macros public 2016-06-29 14:03:46 +02:00
pflash_cfi02.c pflash: make TYPE_CFI_PFLASH0{1,2} macros public 2016-06-29 14:03:46 +02:00
tc58128.c block: Use DIV_ROUND_UP 2016-06-07 18:19:24 +03:00
trace-events trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
virtio-blk.c virtio-blk: handle virtio_blk_handle_request() errors 2016-10-10 01:16:59 +03:00
xen_blkif.h Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
xen_disk.c qdisk - hw/block/xen_disk: grant copy implementation 2016-09-27 18:18:55 -07:00