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 <gr...@kaod.org> > --- > 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 <stefa...@redhat.com>
signature.asc
Description: PGP signature