diff options
Diffstat (limited to 'include/hw/boards.h')
-rw-r--r-- | include/hw/boards.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/hw/boards.h b/include/hw/boards.h index f968a256dc..d268bd00a9 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -114,7 +114,7 @@ struct MachineClass { const char *default_machine_opts; const char *default_boot_order; const char *default_display; - GlobalProperty *compat_props; + GArray *compat_props; const char *hw_version; ram_addr_t default_ram_size; bool option_rom_has_mr; @@ -186,11 +186,18 @@ struct MachineState { #define SET_MACHINE_COMPAT(m, COMPAT) \ do { \ + int i; \ static GlobalProperty props[] = { \ COMPAT \ { /* end of list */ } \ }; \ - (m)->compat_props = props; \ + if (!m->compat_props) { \ + m->compat_props = g_array_new(false, false, sizeof(void *)); \ + } \ + for (i = 0; props[i].driver != NULL; i++) { \ + GlobalProperty *prop = &props[i]; \ + g_array_append_val(m->compat_props, prop); \ + } \ } while (0) #endif |