Received: from eggs.gnu.org ([2001:4830:134:3::10]:45956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPNTy-0000oR-R5 for qemu-devel@nongnu.org; Sun, 16 Mar 2014 22:41:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPNTl-0005NX-CA for qemu-devel@nongnu.org; Sun, 16 Mar 2014 22:40:54 -0400 Received: from e23smtp02.au.ibm.com ([202.81.31.144]:35751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPNTk-0005Mk-Hy for qemu-devel@nongnu.org; Sun, 16 Mar 2014 22:40:41 -0400 Received: from /spool/local by e23smtp02.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 17 Mar 2014 12:40:35 +1000 From: Alexey Kardashevskiy Date: Mon, 17 Mar 2014 13:40:26 +1100 Message-Id: <1395024027-29211-6-git-send-email-aik@ozlabs.ru> In-Reply-To: <1395024027-29211-1-git-send-email-aik@ozlabs.ru> References: <1395024027-29211-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH v7 5/6] spapr: QOM'fy machine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Alexander Graf , =?UTF-8?q?Andreas=20F=C3=A4rber?= Signed-off-by: Alexey Kardashevskiy --- 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