1 /* Declarations for use by board files for creating devices. */
6 #include "qemu/typedefs.h"
7 #include "sysemu/blockdev.h"
9 #include "qom/object.h"
12 typedef struct MachineState MachineState
;
14 typedef void QEMUMachineInitFunc(MachineState
*ms
);
16 typedef void QEMUMachineResetFunc(void);
18 typedef void QEMUMachineHotAddCPUFunc(const int64_t id
, Error
**errp
);
20 typedef int QEMUMachineGetKvmtypeFunc(const char *arg
);
26 QEMUMachineInitFunc
*init
;
27 QEMUMachineResetFunc
*reset
;
28 QEMUMachineHotAddCPUFunc
*hot_add_cpu
;
29 QEMUMachineGetKvmtypeFunc
*kvm_type
;
30 BlockInterfaceType block_default_type
;
31 int units_per_default_bus
;
33 unsigned int no_serial
:1,
41 const char *default_machine_opts
;
42 const char *default_boot_order
;
43 GlobalProperty
*compat_props
;
44 const char *hw_version
;
47 void memory_region_allocate_system_memory(MemoryRegion
*mr
, Object
*owner
,
51 int qemu_register_machine(QEMUMachine
*m
);
53 #define TYPE_MACHINE_SUFFIX "-machine"
54 #define TYPE_MACHINE "machine"
55 #undef MACHINE /* BSD defines it and QEMU does not use it */
56 #define MACHINE(obj) \
57 OBJECT_CHECK(MachineState, (obj), TYPE_MACHINE)
58 #define MACHINE_GET_CLASS(obj) \
59 OBJECT_GET_CLASS(MachineClass, (obj), TYPE_MACHINE)
60 #define MACHINE_CLASS(klass) \
61 OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE)
63 MachineClass
*find_default_machine(void);
64 extern MachineState
*current_machine
;
68 * @qemu_machine: #QEMUMachine
69 * @get_hotplug_handler: this function is called during bus-less
70 * device hotplug. If defined it returns pointer to an instance
71 * of HotplugHandler object, which handles hotplug operation
72 * for a given @dev. It may return NULL if @dev doesn't require
73 * any actions to be performed by hotplug handler.
77 ObjectClass parent_class
;
84 void (*init
)(MachineState
*state
);
86 void (*hot_add_cpu
)(const int64_t id
, Error
**errp
);
87 int (*kvm_type
)(const char *arg
);
89 BlockInterfaceType block_default_type
;
90 int units_per_default_bus
;
92 unsigned int no_serial
:1,
100 const char *default_machine_opts
;
101 const char *default_boot_order
;
102 GlobalProperty
*compat_props
;
103 const char *hw_version
;
105 HotplugHandler
*(*get_hotplug_handler
)(MachineState
*machine
,
112 struct MachineState
{
124 bool dump_guest_core
;
131 ram_addr_t maxram_size
;
133 const char *boot_order
;
134 char *kernel_filename
;
135 char *kernel_cmdline
;
136 char *initrd_filename
;
137 const char *cpu_model
;