From 8c797e758ad41b8dd6ea6f72c6f0194dedb30a2f Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Thu, 12 Jan 2017 23:26:22 +0200 Subject: virtio-ccw: fix ring sizing Current code seems to assume ring size is always decreased but this is not required by spec: what spec says is just that size can not exceed the maximum. Fix it up. Signed-off-by: Michael S. Tsirkin Message-Id: <1484256243-1982-1-git-send-email-mst@redhat.com> Signed-off-by: Cornelia Huck --- hw/virtio/virtio.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hw/virtio/virtio.c') diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c index aa4f38f50a..94d7dbae6c 100644 --- a/hw/virtio/virtio.c +++ b/hw/virtio/virtio.c @@ -1262,6 +1262,11 @@ int virtio_queue_get_num(VirtIODevice *vdev, int n) return vdev->vq[n].vring.num; } +int virtio_queue_get_max_num(VirtIODevice *vdev, int n) +{ + return vdev->vq[n].vring.num_default; +} + int virtio_get_num_queues(VirtIODevice *vdev) { int i; -- cgit 1.4.1