On Wed, 1 Apr 2015 16:15:03 +0800 Jason Wang <jasow...@redhat.com> wrote:
> Instead of depending on marco, using a bus specific limit. Also make > it clear that the number of gsis per I/O adapter is not directly > depending on the number of virtio queues, but rather the other way > around. > > Cc: Alexander Graf <ag...@suse.de> > Cc: Cornelia Huck <cornelia.h...@de.ibm.com> > Cc: Christian Borntraeger <borntrae...@de.ibm.com> > Cc: Richard Henderson <r...@twiddle.net> > Signed-off-by: Jason Wang <jasow...@redhat.com> > --- > hw/s390x/s390-virtio-ccw.c | 7 +++++-- > hw/s390x/virtio-ccw.c | 19 ++++++++++++------- > include/hw/s390x/s390_flic.h | 4 +++- > 3 files changed, 20 insertions(+), 10 deletions(-) > > diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c > index dfe6ded..935b880 100644 > --- a/hw/s390x/virtio-ccw.c > +++ b/hw/s390x/virtio-ccw.c > @@ -265,8 +267,9 @@ static int virtio_ccw_set_vqs(SubchDev *sch, uint64_t > addr, uint32_t align, > uint16_t index, uint16_t num) > { > VirtIODevice *vdev = virtio_ccw_get_vdev(sch); > + int queue_max = virtio_get_queue_max(vdev); > > - if (index > VIRTIO_PCI_QUEUE_MAX) { > + if (index > queue_max) { trivial conflict on master (>= instead of >) > return -EINVAL; > } > In master, there's also a new instance of VIRTIO_PCI_QUEUE_MAX (in virtio_ccw_cb()) which needs a similar treatment. But on the whole, looks good.