aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2016-06-14 15:59:12 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-06-14 15:59:12 +0100
commit7a2ecd95d935bcaf04f56d79cafeb07fb03ddbee (patch)
tree12da5e4bec19cc9879f70fb51915dfe692dedfcf
parent811595a2d4ab8c6354857a50ffd29fafce52a892 (diff)
hw/arm/virt: separate versioned type-init code
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 <drjones@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1465746713-30414-2-git-send-email-drjones@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--hw/arm/virt.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 0f830a35b3..84c7c367e2 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);