diff mbox

[1/5] hw/arm/virt: separate versioned type-init code

Message ID 1465410291-2971-2-git-send-email-drjones@redhat.com
State Superseded
Headers show

Commit Message

Andrew Jones June 8, 2016, 6:24 p.m. UTC
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>

---
 hw/arm/virt.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

-- 
2.4.11

Comments

Peter Maydell June 9, 2016, 6:27 p.m. UTC | #1
On 8 June 2016 at 19:24, Andrew Jones <drjones@redhat.com> wrote:
> 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>


thanks
-- PMM
diff mbox

Patch

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 8e46137e9be71..a0d35d0826590 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1387,6 +1387,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);
@@ -1428,17 +1434,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);