On Thu,  5 Mar 2015 13:48:41 +0800
Jason Wang <jasow...@redhat.com> wrote:

> Instead of depending on marco, using a bus specific limit.
> 
> 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        | 13 +++++++------
>  include/hw/s390x/s390_flic.h |  2 +-
>  include/hw/virtio/virtio.h   |  1 +
>  4 files changed, 14 insertions(+), 9 deletions(-)
> 

> diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
> index 4874622..98a1a90 100644
> --- a/hw/s390x/virtio-ccw.c
> +++ b/hw/s390x/virtio-ccw.c

> @@ -1026,7 +1027,7 @@ static void virtio_ccw_notify(DeviceState *d, uint16_t 
> vector)
Unfortunately just snipped off in this diff, but the code says

if (vector >= 128) {
>          return;
>      }

This is originating from (64 bits for queues + 64 bits for secondary
indicators) - only the first bit of secondary indicators is currently
used (for configuration changes). I'd suggest to change that to
queue_max + 64 and add a comment /* queue indicators + secondary
indicators */ or so.

> 
> -    if (vector < VIRTIO_PCI_QUEUE_MAX) {
> +    if (vector < virtio_get_queue_max(virtio_bus_get_device(&dev->bus))) {
>          if (!dev->indicators) {
>              return;
>          }


Reply via email to