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
;
32 unsigned int no_serial
:1,
40 const char *default_machine_opts
;
41 const char *default_boot_order
;
42 GlobalProperty
*compat_props
;
43 const char *hw_version
;
46 #define TYPE_MACHINE_SUFFIX "-machine"
47 int qemu_register_machine(QEMUMachine
*m
);
49 #define TYPE_MACHINE "machine"
50 #undef MACHINE /* BSD defines it and QEMU does not use it */
51 #define MACHINE(obj) \
52 OBJECT_CHECK(MachineState, (obj), TYPE_MACHINE)
53 #define MACHINE_GET_CLASS(obj) \
54 OBJECT_GET_CLASS(MachineClass, (obj), TYPE_MACHINE)
55 #define MACHINE_CLASS(klass) \
56 OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE)
58 MachineClass
*find_default_machine(void);
59 extern MachineState
*current_machine
;
63 * @qemu_machine: #QEMUMachine
64 * @get_hotplug_handler: this function is called during bus-less
65 * device hotplug. If defined it returns pointer to an instance
66 * of HotplugHandler object, which handles hotplug operation
67 * for a given @dev. It may return NULL if @dev doesn't require
68 * any actions to be performed by hotplug handler.
72 ObjectClass parent_class
;
79 void (*init
)(MachineState
*state
);
81 void (*hot_add_cpu
)(const int64_t id
, Error
**errp
);
82 int (*kvm_type
)(const char *arg
);
84 BlockInterfaceType block_default_type
;
86 unsigned int no_serial
:1,
94 const char *default_machine_opts
;
95 const char *default_boot_order
;
96 GlobalProperty
*compat_props
;
97 const char *hw_version
;
99 HotplugHandler
*(*get_hotplug_handler
)(MachineState
*machine
,
106 struct MachineState
{
118 bool dump_guest_core
;
124 ram_addr_t maxram_size
;
126 const char *boot_order
;
127 char *kernel_filename
;
128 char *kernel_cmdline
;
129 char *initrd_filename
;
130 const char *cpu_model
;