diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2014-03-17 13:40:26 +1100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2014-03-20 02:40:13 +0100 |
commit | 29ee324740fa7af4b7cf0ce9295a07296e9a0f24 (patch) | |
tree | 282936e3ac4e36437376c16913024a9705d7f6ae /hw/ppc | |
parent | 5a06393f1d7edc6274233533aac99a5ded1785ce (diff) | |
download | qemu-29ee324740fa7af4b7cf0ce9295a07296e9a0f24.zip qemu-29ee324740fa7af4b7cf0ce9295a07296e9a0f24.tar.gz qemu-29ee324740fa7af4b7cf0ce9295a07296e9a0f24.tar.bz2 |
spapr: QOM'ify pseries machine
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/ppc')
-rw-r--r-- | hw/ppc/spapr.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 5c9a154..170e083 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 "spapr-machine" + sPAPREnvironment *spapr; int spapr_allocate_irq(int hint, bool lsi) @@ -1410,9 +1412,23 @@ static QEMUMachine spapr_machine = { .kvm_type = spapr_kvm_type, }; -static void spapr_machine_init(void) +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) { - qemu_register_machine(&spapr_machine); + type_register_static(&spapr_machine_info); } -machine_init(spapr_machine_init); +type_init(spapr_machine_register_types) |