machine: MACHINE_TYPE_NAME macro

The macro will be useful to ensure the machine class names follow the
right format to make machine class lookup by class name work correctly.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
Eduardo Habkost 2015-08-20 14:54:27 -07:00 committed by Andreas Färber
parent 6c76b37742
commit c84a8f01b2
2 changed files with 7 additions and 1 deletions

2
vl.c
View file

@ -1452,7 +1452,7 @@ static void qemu_machine_class_init(ObjectClass *oc, void *data)
int qemu_register_machine(QEMUMachine *m)
{
char *name = g_strconcat(m->name, TYPE_MACHINE_SUFFIX, NULL);
char *name = g_strdup_printf(MACHINE_TYPE_NAME("%s"), m->name);
TypeInfo ti = {
.name = name,
.parent = TYPE_MACHINE,