mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
pc: Move compat_props setting inside *_machine_options() functions
This will simplify the DEFINE_PC_MACHINE macro, and will help us to implement reuse of PC_COMPAT_* macros through class_init function reuse, in the future. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
fddd179ab9
commit
25519b062c
3 changed files with 65 additions and 36 deletions
|
@ -529,20 +529,23 @@ static inline void pc_default_machine_options(QEMUMachine *m)
|
|||
m->max_cpus = 255;
|
||||
}
|
||||
|
||||
#define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn, COMPAT) \
|
||||
#define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \
|
||||
static void pc_machine_init_##suffix(void) \
|
||||
{ \
|
||||
static QEMUMachine m = { }; \
|
||||
static GlobalProperty props[] = { \
|
||||
COMPAT \
|
||||
{ /* end of list */ } \
|
||||
}; \
|
||||
optsfn(&m); \
|
||||
m.name = namestr; \
|
||||
m.init = initfn; \
|
||||
m.compat_props = props; \
|
||||
qemu_register_pc_machine(&m); \
|
||||
} \
|
||||
machine_init(pc_machine_init_##suffix)
|
||||
|
||||
#define SET_MACHINE_COMPAT(m, COMPAT) do { \
|
||||
static GlobalProperty props[] = { \
|
||||
COMPAT \
|
||||
{ /* end of list */ } \
|
||||
}; \
|
||||
(m)->compat_props = props; \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue