Skip to content

Commit

Permalink
virtio-s390: introduce virito s390 queue limit
Browse files Browse the repository at this point in the history
Cc: Alexander Graf <agraf@suse.de>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
jasowang authored and mstsirkin committed May 31, 2015
1 parent 10ceaa1 commit 74c8529
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hw/s390x/s390-virtio-bus.c
Expand Up @@ -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);

Expand Down Expand Up @@ -352,7 +354,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;
}
Expand Down Expand Up @@ -475,7 +477,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) {
Expand Down

0 comments on commit 74c8529

Please sign in to comment.