machine: Add machine_register_compat_props() function
Move the compat_props handling to core machine code.
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
diff --git a/vl.c b/vl.c
index ebdeaa0..356713e 100644
--- a/vl.c
+++ b/vl.c
@@ -4448,13 +4448,8 @@
exit (i == 1 ? 1 : 0);
}
- if (machine_class->compat_props) {
- GlobalProperty *p;
- for (i = 0; i < machine_class->compat_props->len; i++) {
- p = g_array_index(machine_class->compat_props, GlobalProperty *, i);
- qdev_prop_register_global(p);
- }
- }
+ machine_register_compat_props(current_machine);
+
qemu_opts_foreach(qemu_find_opts("global"),
global_init_func, NULL, NULL);