]> git.proxmox.com Git - mirror_qemu.git/blame - include/hw/boards.h
tests: Check empty QMP output visitor
[mirror_qemu.git] / include / hw / boards.h
CommitLineData
87ecb68b
PB
1/* Declarations for use by board files for creating devices. */
2
3#ifndef HW_BOARDS_H
4#define HW_BOARDS_H
5
f1e29879 6#include "qemu/typedefs.h"
9c17d615 7#include "sysemu/blockdev.h"
83c9f4ca 8#include "hw/qdev.h"
36d20cb2 9#include "qom/object.h"
b6b61144 10
5f072e1f 11
3ef96221
MA
12typedef struct MachineState MachineState;
13
14typedef void QEMUMachineInitFunc(MachineState *ms);
87ecb68b 15
be522029
DG
16typedef void QEMUMachineResetFunc(void);
17
b4fc7b43
IM
18typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp);
19
135a129a
AK
20typedef int QEMUMachineGetKvmtypeFunc(const char *arg);
21
e689f7c6 22struct QEMUMachine {
87ecb68b 23 const char *name;
3f6599e6 24 const char *alias;
87ecb68b
PB
25 const char *desc;
26 QEMUMachineInitFunc *init;
be522029 27 QEMUMachineResetFunc *reset;
b4fc7b43 28 QEMUMachineHotAddCPUFunc *hot_add_cpu;
135a129a 29 QEMUMachineGetKvmtypeFunc *kvm_type;
2d0d2837 30 BlockInterfaceType block_default_type;
b2097003 31 int max_cpus;
2fe0ee97 32 unsigned int no_serial:1,
986c5f78
GH
33 no_parallel:1,
34 use_virtcon:1,
3ef669e1 35 use_sclp:1,
ac33f8fa
GH
36 no_floppy:1,
37 no_cdrom:1,
38 no_sdcard:1;
0c257437 39 int is_default;
67b724e6 40 const char *default_machine_opts;
c1654732 41 const char *default_boot_order;
458fb679 42 GlobalProperty *compat_props;
93bfef4c 43 const char *hw_version;
e689f7c6 44};
87ecb68b 45
261747f1 46#define TYPE_MACHINE_SUFFIX "-machine"
87ecb68b 47int qemu_register_machine(QEMUMachine *m);
6f338c34 48
36d20cb2 49#define TYPE_MACHINE "machine"
c8897e8e 50#undef MACHINE /* BSD defines it and QEMU does not use it */
36d20cb2
MA
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)
57
0056ae24
MA
58MachineClass *find_default_machine(void);
59extern MachineState *current_machine;
60
36d20cb2
MA
61/**
62 * MachineClass:
63 * @qemu_machine: #QEMUMachine
64 */
65struct MachineClass {
66 /*< private >*/
67 ObjectClass parent_class;
68 /*< public >*/
69
00b4fbe2
MA
70 const char *name;
71 const char *alias;
72 const char *desc;
73
3ef96221 74 void (*init)(MachineState *state);
00b4fbe2
MA
75 void (*reset)(void);
76 void (*hot_add_cpu)(const int64_t id, Error **errp);
77 int (*kvm_type)(const char *arg);
78
79 BlockInterfaceType block_default_type;
80 int max_cpus;
81 unsigned int no_serial:1,
82 no_parallel:1,
83 use_virtcon:1,
84 use_sclp:1,
85 no_floppy:1,
86 no_cdrom:1,
87 no_sdcard:1;
88 int is_default;
89 const char *default_machine_opts;
90 const char *default_boot_order;
91 GlobalProperty *compat_props;
92 const char *hw_version;
36d20cb2
MA
93};
94
95/**
96 * MachineState:
97 */
98struct MachineState {
99 /*< private >*/
100 Object parent_obj;
101 /*< public >*/
102
103 char *accel;
104 bool kernel_irqchip;
105 int kvm_shadow_mem;
36d20cb2
MA
106 char *dtb;
107 char *dumpdtb;
108 int phandle_start;
109 char *dt_compatible;
110 bool dump_guest_core;
111 bool mem_merge;
112 bool usb;
113 char *firmware;
114
3ef96221
MA
115 ram_addr_t ram_size;
116 const char *boot_order;
117 const char *kernel_filename;
118 const char *kernel_cmdline;
119 const char *initrd_filename;
120 const char *cpu_model;
36d20cb2
MA
121};
122
87ecb68b 123#endif