aboutsummaryrefslogtreecommitdiff
path: root/hw/arm
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2015-08-20 14:54:36 -0700
committerAndreas Färber <afaerber@suse.de>2015-09-19 16:39:28 +0200
commit98cec76a7076c4a38e16f1a9de170a7942b3be54 (patch)
tree22f0ef15c6c434a10033aeaf77717851e4fc3127 /hw/arm
parentdcb3d601115eed77aef543fe3a920adc17544e06 (diff)
downloadqemu-98cec76a7076c4a38e16f1a9de170a7942b3be54.zip
qemu-98cec76a7076c4a38e16f1a9de170a7942b3be54.tar.gz
qemu-98cec76a7076c4a38e16f1a9de170a7942b3be54.tar.bz2
machine: Set MachineClass::name automatically
Now all TYPE_MACHINE subclasses use MACHINE_TYPE_NAME to generate the class name. So instead of requiring each subclass to set MachineClass::name manually, we can now set it automatically at the TYPE_MACHINE class_base_init() function. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> [AF/ehabkost: Updated for s390-ccw machines] [AF: Cleanup of intermediate virt and vexpress name handling] Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/arm')
-rw-r--r--hw/arm/vexpress.c8
-rw-r--r--hw/arm/virt.c4
2 files changed, 3 insertions, 9 deletions
diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
index 2bcd312..058abbd 100644
--- a/hw/arm/vexpress.c
+++ b/hw/arm/vexpress.c
@@ -168,10 +168,8 @@ typedef struct {
} VexpressMachineState;
#define TYPE_VEXPRESS_MACHINE "vexpress"
-#define VEXPRESS_A9_MACHINE_NAME "vexpress-a9"
-#define VEXPRESS_A15_MACHINE_NAME "vexpress-a15"
-#define TYPE_VEXPRESS_A9_MACHINE MACHINE_TYPE_NAME(VEXPRESS_A9_MACHINE_NAME)
-#define TYPE_VEXPRESS_A15_MACHINE MACHINE_TYPE_NAME(VEXPRESS_A15_MACHINE_NAME)
+#define TYPE_VEXPRESS_A9_MACHINE MACHINE_TYPE_NAME("vexpress-a9")
+#define TYPE_VEXPRESS_A15_MACHINE MACHINE_TYPE_NAME("vexpress-a15")
#define VEXPRESS_MACHINE(obj) \
OBJECT_CHECK(VexpressMachineState, (obj), TYPE_VEXPRESS_MACHINE)
#define VEXPRESS_MACHINE_GET_CLASS(obj) \
@@ -760,7 +758,6 @@ static void vexpress_a9_class_init(ObjectClass *oc, void *data)
MachineClass *mc = MACHINE_CLASS(oc);
VexpressMachineClass *vmc = VEXPRESS_MACHINE_CLASS(oc);
- mc->name = VEXPRESS_A9_MACHINE_NAME;
mc->desc = "ARM Versatile Express for Cortex-A9";
vmc->daughterboard = &a9_daughterboard;
@@ -771,7 +768,6 @@ static void vexpress_a15_class_init(ObjectClass *oc, void *data)
MachineClass *mc = MACHINE_CLASS(oc);
VexpressMachineClass *vmc = VEXPRESS_MACHINE_CLASS(oc);
- mc->name = VEXPRESS_A15_MACHINE_NAME;
mc->desc = "ARM Versatile Express for Cortex-A15";
vmc->daughterboard = &a15_daughterboard;
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index fba2595..6bf0d6d 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -83,8 +83,7 @@ typedef struct {
bool highmem;
} VirtMachineState;
-#define VIRT_MACHINE_NAME "virt"
-#define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME(VIRT_MACHINE_NAME)
+#define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME("virt")
#define VIRT_MACHINE(obj) \
OBJECT_CHECK(VirtMachineState, (obj), TYPE_VIRT_MACHINE)
#define VIRT_MACHINE_GET_CLASS(obj) \
@@ -1074,7 +1073,6 @@ static void virt_class_init(ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(oc);
- mc->name = VIRT_MACHINE_NAME;
mc->desc = "ARM Virtual Machine",
mc->init = machvirt_init;
mc->max_cpus = 8;