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"
11 typedef struct QEMUMachineInitArgs
{
12 const MachineClass
*machine
;
14 const char *boot_order
;
15 const char *kernel_filename
;
16 const char *kernel_cmdline
;
17 const char *initrd_filename
;
18 const char *cpu_model
;
19 } QEMUMachineInitArgs
;
21 typedef void QEMUMachineInitFunc(QEMUMachineInitArgs
*args
);
23 typedef void QEMUMachineResetFunc(void);
25 typedef void QEMUMachineHotAddCPUFunc(const int64_t id
, Error
**errp
);
27 typedef int QEMUMachineGetKvmtypeFunc(const char *arg
);
33 QEMUMachineInitFunc
*init
;
34 QEMUMachineResetFunc
*reset
;
35 QEMUMachineHotAddCPUFunc
*hot_add_cpu
;
36 QEMUMachineGetKvmtypeFunc
*kvm_type
;
37 BlockInterfaceType block_default_type
;
39 unsigned int no_serial
:1,
47 const char *default_machine_opts
;
48 const char *default_boot_order
;
49 GlobalProperty
*compat_props
;
50 const char *hw_version
;
53 #define TYPE_MACHINE_SUFFIX "-machine"
54 int qemu_register_machine(QEMUMachine
*m
);
56 #define TYPE_MACHINE "machine"
57 #undef MACHINE /* BSD defines it and QEMU does not use it */
58 #define MACHINE(obj) \
59 OBJECT_CHECK(MachineState, (obj), TYPE_MACHINE)
60 #define MACHINE_GET_CLASS(obj) \
61 OBJECT_GET_CLASS(MachineClass, (obj), TYPE_MACHINE)
62 #define MACHINE_CLASS(klass) \
63 OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE)
65 typedef struct MachineState MachineState
;
67 MachineClass
*find_default_machine(void);
68 extern MachineState
*current_machine
;
72 * @qemu_machine: #QEMUMachine
76 ObjectClass parent_class
;
79 QEMUMachine
*qemu_machine
;
85 void (*init
)(QEMUMachineInitArgs
*args
);
87 void (*hot_add_cpu
)(const int64_t id
, Error
**errp
);
88 int (*kvm_type
)(const char *arg
);
90 BlockInterfaceType block_default_type
;
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
;
109 struct MachineState
{
124 bool dump_guest_core
;
129 QEMUMachineInitArgs init_args
;