summaryrefslogtreecommitdiff
path: root/include/hw/i386/pc.h
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2015-05-15 14:18:55 -0300
committerMichael S. Tsirkin <mst@redhat.com>2015-05-31 16:26:42 +0200
commit25519b062c70f2afe2d2f0c262f3838a41e8bc7c (patch)
treea20e885f180b090817ea4d2db7b4620f4e472604 /include/hw/i386/pc.h
parentfddd179ab962f6f78a8493742e1068d6a620e059 (diff)
downloadqemu-25519b062c70f2afe2d2f0c262f3838a41e8bc7c.zip
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>
Diffstat (limited to 'include/hw/i386/pc.h')
-rw-r--r--include/hw/i386/pc.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 7a70d1f8b6..c4f080878d 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -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