Signed-off-by: Alexey Kardashevskiy <a...@ozlabs.ru> --- Changes: v8: * QOM'ed according to the latest rules from 2.0-rc0. --- hw/ppc/spapr.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 5c9a154..43b9fcb 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -81,6 +81,8 @@ #define HTAB_SIZE(spapr) (1ULL << ((spapr)->htab_shift)) +#define TYPE_SPAPR_MACHINE "machine-spapr" + sPAPREnvironment *spapr; int spapr_allocate_irq(int hint, bool lsi) @@ -1416,3 +1418,24 @@ static void spapr_machine_init(void) } machine_init(spapr_machine_init); + +static void spapr_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->qemu_machine = data; +} + +static const TypeInfo spapr_machine_info = { + .name = TYPE_SPAPR_MACHINE, + .parent = TYPE_MACHINE, + .class_init = spapr_machine_class_init, + .class_data = &spapr_machine, +}; + +static void spapr_machine_register_types(void) +{ + type_register_static(&spapr_machine_info); +} + +type_init(spapr_machine_register_types) -- 1.8.4.rc4