]> git.proxmox.com Git - mirror_qemu.git/blobdiff - include/hw/i386/pc.h
pc: Define machines using a DEFINE_PC_MACHINE macro
[mirror_qemu.git] / include / hw / i386 / pc.h
index 672f1f7b410229dc7d70855f0c229c824ccca634..a5b1fb02bb047a593e48c0ee5b345d730cf1eea8 100644 (file)
@@ -525,4 +525,20 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
     .hot_add_cpu = pc_hot_add_cpu, \
     .max_cpus = 255
 
+#define DEFINE_PC_MACHINE(suffix, namestr, initfn, OPTS, COMPAT) \
+    static QEMUMachine pc_machine_##suffix = { \
+        OPTS, \
+        .name = namestr, \
+        .init = initfn, \
+        .compat_props = (GlobalProperty[]) { \
+            COMPAT \
+            { /* end of list */ } \
+        }, \
+    }; \
+    static void pc_machine_init_##suffix(void) \
+    { \
+        qemu_register_pc_machine(&pc_machine_##suffix); \
+    } \
+    machine_init(pc_machine_init_##suffix)
+
 #endif