From 416343b144cb6a5d73b381e56f452fdbd5992522 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 26 May 2011 11:52:46 +0200 Subject: spapr: make irq customizable via qdev This also lets the user see the irq in "info qtree". Signed-off-by: Paolo Bonzini Cc: Alexander Graf Cc: David Gibson Signed-off-by: Alexander Graf --- hw/spapr_vio.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/spapr_vio.c b/hw/spapr_vio.c index ba2e1c178b..0546ccb043 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); -- cgit v1.2.3