From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8UCa-0002J8-UC for qemu-devel@nongnu.org; Tue, 06 Jan 2015 08:29:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y8UCW-0002N1-UL for qemu-devel@nongnu.org; Tue, 06 Jan 2015 08:29:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y8UCW-0002Mw-Nz for qemu-devel@nongnu.org; Tue, 06 Jan 2015 08:29:36 -0500 From: Marcel Apfelbaum Date: Tue, 6 Jan 2015 15:29:15 +0200 Message-Id: <1420550957-22337-5-git-send-email-marcel@redhat.com> In-Reply-To: <1420550957-22337-1-git-send-email-marcel@redhat.com> References: <1420550957-22337-1-git-send-email-marcel@redhat.com> Subject: [Qemu-devel] [PATCH 4/6] hw/ppc/mac_newworld: QOMified mac99 machines List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, mst@redhat.com, lersek@redhat.com, agraf@suse.de, stefanha@redhat.com, pbonzini@redhat.com, afaerber@suse.de, rth@twiddle.net Signed-off-by: Marcel Apfelbaum --- hw/ppc/mac_newworld.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index ed37d6b..b54f94a 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -502,18 +502,27 @@ static int core99_kvm_type(const char *arg) return 2; } -static QEMUMachine core99_machine = { - .name = "mac99", - .desc = "Mac99 based PowerMAC", - .init = ppc_core99_init, - .max_cpus = MAX_CPUS, - .default_boot_order = "cd", - .kvm_type = core99_kvm_type, +static void core99_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc = MACHINE_CLASS(oc); + + mc->name = "mac99"; + mc->desc = "Mac99 based PowerMAC"; + mc->init = ppc_core99_init; + mc->max_cpus = MAX_CPUS; + mc->default_boot_order = "cd"; + mc->kvm_type = core99_kvm_type; +} + +static const TypeInfo core99_machine_info = { + .name = "mac99-machine", + .parent = TYPE_MACHINE, + .class_init = core99_machine_class_init, }; -static void core99_machine_init(void) +static void mac_machine_register_types(void) { - qemu_register_machine(&core99_machine); + type_register_static(&core99_machine_info); } -machine_init(core99_machine_init); +type_init(mac_machine_register_types) -- 2.1.0