Re: [Qemu-devel] [RFC 6/7] virtio: handle virtqueue_num_heads() errors

2016-03-25 Thread Fam Zheng
On Thu, 03/24 17:56, Stefan Hajnoczi wrote: > If the index avail ring index is bogus virtqueue_num_heads() must return s/index avail/avail/ ? > -EINVAL. > > The only caller is virtqueue_get_avail_bytes(). Return saying no bytes > are available when virtqueue_num_heads() fails. > > Signed-off-b

[Qemu-devel] [RFC 6/7] virtio: handle virtqueue_num_heads() errors

2016-03-24 Thread Stefan Hajnoczi
If the index avail ring index is bogus virtqueue_num_heads() must return -EINVAL. The only caller is virtqueue_get_avail_bytes(). Return saying no bytes are available when virtqueue_num_heads() fails. Signed-off-by: Stefan Hajnoczi --- hw/virtio/virtio.c | 11 --- 1 file changed, 8 ins