mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
machines: replace COMPAT define with a static array
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
parent
ea9ce8934c
commit
fa386d989d
6 changed files with 567 additions and 428 deletions
|
@ -289,18 +289,14 @@ struct MachineState {
|
|||
} \
|
||||
type_init(machine_initfn##_register_types)
|
||||
|
||||
#define SET_MACHINE_COMPAT(m, COMPAT) \
|
||||
#define SET_MACHINE_COMPAT(m, compat) \
|
||||
do { \
|
||||
int i; \
|
||||
static GlobalProperty props[] = { \
|
||||
COMPAT \
|
||||
{ /* end of list */ } \
|
||||
}; \
|
||||
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]; \
|
||||
for (i = 0; i < G_N_ELEMENTS(compat); i++) { \
|
||||
GlobalProperty *prop = &compat[i]; \
|
||||
g_array_append_val(m->compat_props, prop); \
|
||||
} \
|
||||
} while (0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue