From patchwork Tue Jun 14 14:13:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 9175937 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0CD4160772 for ; Tue, 14 Jun 2016 14:25:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D584A28332 for ; Tue, 14 Jun 2016 14:25:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C75DB28333; Tue, 14 Jun 2016 14:25:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 44A9F28326 for ; Tue, 14 Jun 2016 14:25:40 +0000 (UTC) Received: from localhost ([::1]:35663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCpHf-0005yA-9m for patchwork-qemu-devel@patchwork.kernel.org; Tue, 14 Jun 2016 10:25:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCp6Z-0003IK-5q for qemu-devel@nongnu.org; Tue, 14 Jun 2016 10:14:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCp6X-0007zW-3j for qemu-devel@nongnu.org; Tue, 14 Jun 2016 10:14:10 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:57706) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCp6W-0007yr-St for qemu-devel@nongnu.org; Tue, 14 Jun 2016 10:14:09 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1bCp6W-0006DL-CR for qemu-devel@nongnu.org; Tue, 14 Jun 2016 15:14:08 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 14 Jun 2016 15:13:40 +0100 Message-Id: <1465913645-19346-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465913645-19346-1-git-send-email-peter.maydell@linaro.org> References: <1465913645-19346-1-git-send-email-peter.maydell@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 05/30] hw/arm/virt: separate versioned type-init code X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Andrew Jones Rename machvirt_info (which is specifically for 2.6 TypeInfo) to machvirt_2_6_info, and separate the type registration of the abstract machine type from the versioned type. Signed-off-by: Andrew Jones Reviewed-by: Peter Maydell Message-id: 1465746713-30414-2-git-send-email-drjones@redhat.com Signed-off-by: Peter Maydell --- hw/arm/virt.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 0f830a3..84c7c36 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1420,6 +1420,12 @@ static const TypeInfo virt_machine_info = { .class_init = virt_machine_class_init, }; +static void machvirt_machine_init(void) +{ + type_register_static(&virt_machine_info); +} +type_init(machvirt_machine_init); + static void virt_2_6_instance_init(Object *obj) { VirtMachineState *vms = VIRT_MACHINE(obj); @@ -1461,17 +1467,15 @@ static void virt_2_6_class_init(ObjectClass *oc, void *data) mc->alias = "virt"; } -static const TypeInfo machvirt_info = { +static const TypeInfo machvirt_2_6_info = { .name = MACHINE_TYPE_NAME("virt-2.6"), .parent = TYPE_VIRT_MACHINE, .instance_init = virt_2_6_instance_init, .class_init = virt_2_6_class_init, }; -static void machvirt_machine_init(void) +static void machvirt_machine_2_6_init(void) { - type_register_static(&virt_machine_info); - type_register_static(&machvirt_info); + type_register_static(&machvirt_2_6_info); } - -type_init(machvirt_machine_init); +type_init(machvirt_machine_2_6_init);