aboutsummaryrefslogtreecommitdiff
path: root/hw/core/machine.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/core/machine.c')
-rw-r--r--hw/core/machine.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 3c1f248e80..f4db340468 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -319,8 +319,11 @@ static void machine_class_init(ObjectClass *oc, void *data)
static void machine_class_base_init(ObjectClass *oc, void *data)
{
if (!object_class_is_abstract(oc)) {
+ MachineClass *mc = MACHINE_CLASS(oc);
const char *cname = object_class_get_name(oc);
assert(g_str_has_suffix(cname, TYPE_MACHINE_SUFFIX));
+ mc->name = g_strndup(cname,
+ strlen(cname) - strlen(TYPE_MACHINE_SUFFIX));
}
}