On 27.05.14 07:36, Alexey Kardashevskiy wrote:
The spapr-pci PHB initializes IOMMU for emulated devices only.
The upcoming VFIO support will do it different. However both emulated
and VFIO PHB types share most of the initialization code.
For the type specific things a new finish_realize() callback is
introduced.
This introduces sPAPRPHBClass derived from PCIHostBridgeClass and
adds the callback pointer.
This implements finish_realize() for emulated devices.
Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru>
This patch breaks compilation on some of my test hosts:
05/28 12:41:34 ERROR| utils:0144| [stderr] In file included from
/usr/local/autotest/tmp/virt/src/qemu/hw/ppc/spapr.c:45:
05/28 12:41:34 ERROR| utils:0144| [stderr]
/usr/local/autotest/tmp/virt/src/qemu/include/hw/pci-host/spapr.h:77: error:
redefinition of typedef ‘sPAPRPHBState’
05/28 12:41:34 ERROR| utils:0144| [stderr]
/usr/local/autotest/tmp/virt/src/qemu/include/hw/pci-host/spapr.h:43: error:
previous declaration of ‘sPAPRPHBState’ was here
05/28 12:41:34 ERROR| utils:0144| [stderr] make[1]: *** [hw/ppc/spapr.o]
Error 1
05/28 12:41:34 ERROR| utils:0144| [stderr] make: *** [subdir-ppc64-softmmu]
Error 2
I've squashed the following patch into this one to make it compile:
diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h
index ab29281..0f428a1 100644
--- a/include/hw/pci-host/spapr.h
+++ b/include/hw/pci-host/spapr.h
@@ -48,7 +48,7 @@ struct sPAPRPHBClass {
void (*finish_realize)(sPAPRPHBState *sphb, Error **errp);
};
-typedef struct sPAPRPHBState {
+struct sPAPRPHBState {
PCIHostState parent_obj;
int32_t index;
@@ -76,7 +76,7 @@ typedef struct sPAPRPHBState {
} msi_table[SPAPR_MSIX_MAX_DEVS];
QLIST_ENTRY(sPAPRPHBState) list;
-} sPAPRPHBState;
+};
#define SPAPR_PCI_BASE_BUID 0x800000020000000ULL
Alex