qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 03/58] spapr: make irq customizable via qdev


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH 03/58] spapr: make irq customizable via qdev
Date: Thu, 15 Sep 2011 13:15:29 +1000
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Sep 14, 2011 at 10:42:27AM +0200, Alexander Graf wrote:
> From: Paolo Bonzini <address@hidden>
> 
> This also lets the user see the irq in "info qtree".

Um.. I'm a bit confused by this one.  The previous patch comment
implies it's a preparation for this, but then you add the new irq
property to the BusInfo, rather than to the macro that goes into the
DeviceInfos.  Why does this one go in the bus, rather than the device?

> 
> Signed-off-by: Paolo Bonzini <address@hidden>
> Cc: Alexander Graf <address@hidden>
> Cc: David Gibson <address@hidden>
> Signed-off-by: Alexander Graf <address@hidden>
> ---
>  hw/spapr_vio.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/spapr_vio.c b/hw/spapr_vio.c
> index ba2e1c1..0546ccb 100644
> --- a/hw/spapr_vio.c
> +++ b/hw/spapr_vio.c
> @@ -52,6 +52,10 @@
>  static struct BusInfo spapr_vio_bus_info = {
>      .name       = "spapr-vio",
>      .size       = sizeof(VIOsPAPRBus),
> +    .props = (Property[]) {
> +        DEFINE_PROP_UINT32("irq", VIOsPAPRDevice, vio_irq_num, 0), \
> +        DEFINE_PROP_END_OF_LIST(),
> +    },
>  };
>  
>  VIOsPAPRDevice *spapr_vio_find_by_reg(VIOsPAPRBus *bus, uint32_t reg)
> @@ -604,7 +608,9 @@ static int spapr_vio_busdev_init(DeviceState *qdev, 
> DeviceInfo *qinfo)
>      }
>  
>      dev->qdev.id = id;
> -    dev->vio_irq_num = bus->irq++;
> +    if (!dev->vio_irq_num) {
> +        dev->vio_irq_num = bus->irq++;
> +    }
>      dev->qirq = spapr_find_qirq(spapr, dev->vio_irq_num);
>  
>      rtce_init(dev);

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson



reply via email to

[Prev in Thread] Current Thread [Next in Thread]