virtio: handle virtqueue_get_avail_bytes() errors
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 21 Sep 2016 15:52:22 +0000 (16:52 +0100)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 23 Sep 2016 16:03:56 +0000 (19:03 +0300)
commitd65abf85e7e5fce31905eaea322ef2ea26e5f2db
tree228d3597cc24c38537e417ae27b90990f8aacdd3
parentec55da192403e4a1e05f767c8762273d43ea7da4
virtio: handle virtqueue_get_avail_bytes() errors

If the vring is invalid, tell the caller no bytes are available and mark
the device broken.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/virtio/virtio.c