Subject: [PATCH 16/20] virtio-s390: introduce virito s390 queue limit

From: Xiao Wang <[email-masked]>
Date: Thu, 18 Jun 2015 06:11:52 +0200

Message-id: <[email-masked]>
Patchwork-id: 66314
O-Subject: [RHEL7.2 qemu-kvm-rhev PATCH 16/20] virtio-s390: introduce virito s390 queue limit
Bugzilla: 1231610
RH-Acked-by: Stefan Hajnoczi <[email-masked]>
RH-Acked-by: Vlad Yasevich <[email-masked]>
RH-Acked-by: Michael S. Tsirkin <[email-masked]>

Cc: Alexander Graf <[email-masked]>
Cc: Richard Henderson <[email-masked]>
Signed-off-by: Jason Wang <[email-masked]>
Reviewed-by: Michael S. Tsirkin <[email-masked]>
Signed-off-by: Michael S. Tsirkin <[email-masked]>
(cherry picked from commit 74c85296dc880568005b8e7572e08a39d66bcdca)
Signed-off-by: Miroslav Rezanina <[email-masked]>
---
 hw/s390x/s390-virtio-bus.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/s390x/s390-virtio-bus.c b/hw/s390x/s390-virtio-bus.c
index 047c963..34d0708 100644
--- a/hw/s390x/s390-virtio-bus.c
+++ b/hw/s390x/s390-virtio-bus.c
@@ -45,6 +45,8 @@
     do { } while (0)
 #endif
 
+#define VIRTIO_S390_QUEUE_MAX 64
+
 static void virtio_s390_bus_new(VirtioBusState *bus, size_t bus_size,
                                 VirtIOS390Device *dev);
 
@@ -344,7 +346,7 @@ static ram_addr_t s390_virtio_device_num_vq(VirtIOS390Device *dev)
     VirtIODevice *vdev = dev->vdev;
     int num_vq;
 
-    for (num_vq = 0; num_vq < VIRTIO_PCI_QUEUE_MAX; num_vq++) {
+    for (num_vq = 0; num_vq < VIRTIO_S390_QUEUE_MAX; num_vq++) {
         if (!virtio_queue_get_num(vdev, num_vq)) {
             break;
         }
@@ -446,7 +448,7 @@ VirtIOS390Device *s390_virtio_bus_find_vring(VirtIOS390Bus *bus,
     QTAILQ_FOREACH(kid, &bus->bus.children, sibling) {
         VirtIOS390Device *dev = (VirtIOS390Device *)kid->child;
 
-        for(i = 0; i < VIRTIO_PCI_QUEUE_MAX; i++) {
+        for (i = 0; i < VIRTIO_S390_QUEUE_MAX; i++) {
             if (!virtio_queue_get_addr(dev->vdev, i))
                 break;
             if (virtio_queue_get_addr(dev->vdev, i) == mem) {
-- 
1.8.3.1