qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/3] spapr: allow creating devices with -device


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 1/3] spapr: allow creating devices with -device
Date: Wed, 25 May 2011 09:29:26 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 05/25/2011 12:12 AM, David Gibson wrote:
@@ -602,6 +604,8 @@ static int spapr_vio_busdev_init(DeviceState *qdev, 
DeviceInfo *qinfo)
      }

      dev->qdev.id = id;
+    dev->vio_irq_num = bus->irq++;
+    dev->qirq = xics_find_qirq(spapr->icp, dev->vio_irq_num);

I'd prefer to see an spapr_allocate_irq() function, rather than open
coding this multiple times.

I don't understand. This is the only call to xics_find_qirq, unlike before this patch. It's not open coded multiple times.

I can surely add a spapr_allocate_irq() function that would keep the code independent of the particular interrupt controller. Would you prefer something that gives back the virtual IRQ number as well:

    qemu_irq *spapr_allocate_irq(uint32_t *p_vio_irq_num)

or should I keep that in the VIOsPAPRBus, like this:

    qemu_irq *spapr_allocate_irq(uint32_t p_vio_irq_num)

?  Should I pass a sPAPREnvironment too, or should it just use the global?

Paolo



reply via email to

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