diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2011-05-26 11:52:44 +0200 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2011-10-06 09:43:32 +0200 |
commit | 277f9acf79bbf3affb98200c92a4aedaa3234083 (patch) | |
tree | 22e0de4b17274a15dcdf47bc0c027e0757db76aa /hw/spapr.h | |
parent | e4fc8781db7c49b0c5ac5d24762e17c59dfe0871 (diff) | |
download | qemu-277f9acf79bbf3affb98200c92a4aedaa3234083.zip qemu-277f9acf79bbf3affb98200c92a4aedaa3234083.tar.gz qemu-277f9acf79bbf3affb98200c92a4aedaa3234083.tar.bz2 |
spapr: proper qdevification
Right now the spapr devices cannot be instantiated with -device,
because the IRQs need to be passed to the spapr_*_create functions.
Do this instead in the bus's init wrapper.
This is particularly important with the conversion from scsi-disk
to scsi-{cd,hd} that Markus made. After his patches, if you
specify a scsi-cd device attached to an if=none drive, the default
VSCSI controller will not be created and, without qdevification,
you will not be able to add yours.
NOTE from agraf: added small compile fix
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Alexander Graf <agraf@suse.de>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw/spapr.h')
-rw-r--r-- | hw/spapr.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1,6 +1,8 @@ #if !defined(__HW_SPAPR_H__) #define __HW_SPAPR_H__ +#include "hw/xics.h" + struct VIOsPAPRBus; struct icp_state; @@ -278,6 +280,12 @@ void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn); target_ulong spapr_hypercall(CPUState *env, target_ulong opcode, target_ulong *args); +static inline qemu_irq spapr_find_qirq(sPAPREnvironment *spapr, + int irq_num) +{ + return xics_find_qirq(spapr->icp, irq_num); +} + static inline uint32_t rtas_ld(target_ulong phys, int n) { return ldl_be_phys(phys + 4*n); |