root / include / sysemu / sysemu.h @ 3bd88451
History | View | Annotate | Download (5.6 kB)
1 | 87ecb68b | pbrook | #ifndef SYSEMU_H
|
---|---|---|---|
2 | 87ecb68b | pbrook | #define SYSEMU_H
|
3 | 87ecb68b | pbrook | /* Misc. things related to the system emulator. */
|
4 | 87ecb68b | pbrook | |
5 | 1de7afc9 | Paolo Bonzini | #include "qemu/typedefs.h" |
6 | 1de7afc9 | Paolo Bonzini | #include "qemu/option.h" |
7 | 1de7afc9 | Paolo Bonzini | #include "qemu/queue.h" |
8 | 1de7afc9 | Paolo Bonzini | #include "qemu/timer.h" |
9 | 1fa9a5e4 | Luiz Capitulino | #include "qapi-types.h" |
10 | 1de7afc9 | Paolo Bonzini | #include "qemu/notify.h" |
11 | 1de7afc9 | Paolo Bonzini | #include "qemu/main-loop.h" |
12 | 376253ec | aliguori | |
13 | 87ecb68b | pbrook | /* vl.c */
|
14 | 1dfb4dd9 | Luiz Capitulino | |
15 | 87ecb68b | pbrook | extern const char *bios_name; |
16 | 5cea8590 | Paul Brook | |
17 | 87ecb68b | pbrook | extern const char *qemu_name; |
18 | 8fcb1b90 | blueswir1 | extern uint8_t qemu_uuid[];
|
19 | c4be29ff | aliguori | int qemu_uuid_parse(const char *str, uint8_t *uuid); |
20 | 8fcb1b90 | blueswir1 | #define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx" |
21 | 87ecb68b | pbrook | |
22 | f5bbfba1 | Luiz Capitulino | bool runstate_check(RunState state);
|
23 | f5bbfba1 | Luiz Capitulino | void runstate_set(RunState new_state);
|
24 | 1354869c | Luiz Capitulino | int runstate_is_running(void); |
25 | 87ecb68b | pbrook | typedef struct vm_change_state_entry VMChangeStateEntry; |
26 | 1dfb4dd9 | Luiz Capitulino | typedef void VMChangeStateHandler(void *opaque, int running, RunState state); |
27 | 87ecb68b | pbrook | |
28 | 87ecb68b | pbrook | VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb, |
29 | 87ecb68b | pbrook | void *opaque);
|
30 | 87ecb68b | pbrook | void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
|
31 | 1dfb4dd9 | Luiz Capitulino | void vm_state_notify(int running, RunState state); |
32 | e07bbac5 | Jan Kiszka | |
33 | e063eb1f | Jan Kiszka | #define VMRESET_SILENT false |
34 | e063eb1f | Jan Kiszka | #define VMRESET_REPORT true |
35 | e063eb1f | Jan Kiszka | |
36 | 87ecb68b | pbrook | void vm_start(void); |
37 | 1dfb4dd9 | Luiz Capitulino | void vm_stop(RunState state);
|
38 | 8a9236f1 | Luiz Capitulino | void vm_stop_force_state(RunState state);
|
39 | 87ecb68b | pbrook | |
40 | 95b363b5 | Gerd Hoffmann | typedef enum WakeupReason { |
41 | 95b363b5 | Gerd Hoffmann | QEMU_WAKEUP_REASON_OTHER = 0,
|
42 | 62aeb0f7 | Gerd Hoffmann | QEMU_WAKEUP_REASON_RTC, |
43 | 6595abc0 | Gerd Hoffmann | QEMU_WAKEUP_REASON_PMTIMER, |
44 | 95b363b5 | Gerd Hoffmann | } WakeupReason; |
45 | 95b363b5 | Gerd Hoffmann | |
46 | 87ecb68b | pbrook | void qemu_system_reset_request(void); |
47 | 95b363b5 | Gerd Hoffmann | void qemu_system_suspend_request(void); |
48 | 95b363b5 | Gerd Hoffmann | void qemu_register_suspend_notifier(Notifier *notifier);
|
49 | 95b363b5 | Gerd Hoffmann | void qemu_system_wakeup_request(WakeupReason reason);
|
50 | 95b363b5 | Gerd Hoffmann | void qemu_system_wakeup_enable(WakeupReason reason, bool enabled); |
51 | 95b363b5 | Gerd Hoffmann | void qemu_register_wakeup_notifier(Notifier *notifier);
|
52 | 87ecb68b | pbrook | void qemu_system_shutdown_request(void); |
53 | 87ecb68b | pbrook | void qemu_system_powerdown_request(void); |
54 | a9552c8e | Igor Mammedov | void qemu_register_powerdown_notifier(Notifier *notifier);
|
55 | 8cf71710 | Jan Kiszka | void qemu_system_debug_request(void); |
56 | 1dfb4dd9 | Luiz Capitulino | void qemu_system_vmstop_request(RunState reason);
|
57 | 1291eb35 | Anthony PERARD | int qemu_shutdown_requested_get(void); |
58 | 1291eb35 | Anthony PERARD | int qemu_reset_requested_get(void); |
59 | f64622c4 | Gleb Natapov | void qemu_system_killed(int signal, pid_t pid); |
60 | be522029 | David Gibson | void qemu_devices_reset(void); |
61 | e063eb1f | Jan Kiszka | void qemu_system_reset(bool report); |
62 | 87ecb68b | pbrook | |
63 | fd42deeb | Gerd Hoffmann | void qemu_add_exit_notifier(Notifier *notify);
|
64 | fd42deeb | Gerd Hoffmann | void qemu_remove_exit_notifier(Notifier *notify);
|
65 | fd42deeb | Gerd Hoffmann | |
66 | 4cab946a | Gleb Natapov | void qemu_add_machine_init_done_notifier(Notifier *notify);
|
67 | 4cab946a | Gleb Natapov | |
68 | d54908a5 | Luiz Capitulino | void do_savevm(Monitor *mon, const QDict *qdict); |
69 | 03cd4655 | Markus Armbruster | int load_vmstate(const char *name); |
70 | d54908a5 | Luiz Capitulino | void do_delvm(Monitor *mon, const QDict *qdict); |
71 | 84f2d0ea | Wenchao Xia | void do_info_snapshots(Monitor *mon, const QDict *qdict); |
72 | 87ecb68b | pbrook | |
73 | 210f41ba | aliguori | void qemu_announce_self(void); |
74 | 210f41ba | aliguori | |
75 | e1c37d0e | Luiz Capitulino | bool qemu_savevm_state_blocked(Error **errp);
|
76 | 47c8c17a | Paolo Bonzini | void qemu_savevm_state_begin(QEMUFile *f,
|
77 | 47c8c17a | Paolo Bonzini | const MigrationParams *params);
|
78 | 539de124 | Luiz Capitulino | int qemu_savevm_state_iterate(QEMUFile *f);
|
79 | 47c8c17a | Paolo Bonzini | void qemu_savevm_state_complete(QEMUFile *f);
|
80 | 6522773f | Juan Quintela | void qemu_savevm_state_cancel(void); |
81 | e4ed1541 | Juan Quintela | uint64_t qemu_savevm_state_pending(QEMUFile *f, uint64_t max_size); |
82 | 9366f418 | aliguori | int qemu_loadvm_state(QEMUFile *f);
|
83 | 9366f418 | aliguori | |
84 | 87ecb68b | pbrook | /* SLIRP */
|
85 | 376253ec | aliguori | void do_info_slirp(Monitor *mon);
|
86 | 87ecb68b | pbrook | |
87 | 993fbfdb | Anthony Liguori | typedef enum DisplayType |
88 | 993fbfdb | Anthony Liguori | { |
89 | 993fbfdb | Anthony Liguori | DT_DEFAULT, |
90 | 993fbfdb | Anthony Liguori | DT_CURSES, |
91 | 993fbfdb | Anthony Liguori | DT_SDL, |
92 | a4ccabcf | Anthony Liguori | DT_GTK, |
93 | 993fbfdb | Anthony Liguori | DT_NOGRAPHIC, |
94 | 4171d32e | Jes Sorensen | DT_NONE, |
95 | 993fbfdb | Anthony Liguori | } DisplayType; |
96 | 993fbfdb | Anthony Liguori | |
97 | d399f677 | Paolo Bonzini | extern int autostart; |
98 | 86176759 | Zachary Amsden | |
99 | 86176759 | Zachary Amsden | typedef enum { |
100 | a19cbfb3 | Gerd Hoffmann | VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL, |
101 | 86176759 | Zachary Amsden | } VGAInterfaceType; |
102 | 86176759 | Zachary Amsden | |
103 | 86176759 | Zachary Amsden | extern int vga_interface_type; |
104 | 86176759 | Zachary Amsden | #define xenfb_enabled (vga_interface_type == VGA_XENFB)
|
105 | a19cbfb3 | Gerd Hoffmann | #define qxl_enabled (vga_interface_type == VGA_QXL)
|
106 | 86176759 | Zachary Amsden | |
107 | 87ecb68b | pbrook | extern int graphic_width; |
108 | 87ecb68b | pbrook | extern int graphic_height; |
109 | 87ecb68b | pbrook | extern int graphic_depth; |
110 | 993fbfdb | Anthony Liguori | extern DisplayType display_type;
|
111 | 87ecb68b | pbrook | extern const char *keyboard_layout; |
112 | 87ecb68b | pbrook | extern int win2k_install_hack; |
113 | 87ecb68b | pbrook | extern int alt_grab; |
114 | 0ca9f8a4 | Dustin Kirkland | extern int ctrl_grab; |
115 | 87ecb68b | pbrook | extern int smp_cpus; |
116 | 6be68d7e | Jes Sorensen | extern int max_cpus; |
117 | 87ecb68b | pbrook | extern int cursor_hide; |
118 | 87ecb68b | pbrook | extern int graphic_rotate; |
119 | 87ecb68b | pbrook | extern int no_quit; |
120 | a691d41a | Luiz Capitulino | extern int no_shutdown; |
121 | 87ecb68b | pbrook | extern int semihosting_enabled; |
122 | 87ecb68b | pbrook | extern int old_param; |
123 | 95387491 | Jan Kiszka | extern int boot_menu; |
124 | 3d3b8303 | wayne | extern uint8_t *boot_splash_filedata;
|
125 | d09acb9b | Markus Armbruster | extern size_t boot_splash_filedata_size;
|
126 | 3d3b8303 | wayne | extern uint8_t qemu_extra_params_fw[2]; |
127 | 6875204c | Jan Kiszka | extern QEMUClock *rtc_clock;
|
128 | 87ecb68b | pbrook | |
129 | 268a362c | aliguori | #define MAX_NODES 64 |
130 | ee785fed | Chegu Vinod | #define MAX_CPUMASK_BITS 255 |
131 | 268a362c | aliguori | extern int nb_numa_nodes; |
132 | 268a362c | aliguori | extern uint64_t node_mem[MAX_NODES];
|
133 | ee785fed | Chegu Vinod | extern unsigned long *node_cpumask[MAX_NODES]; |
134 | 268a362c | aliguori | |
135 | 87ecb68b | pbrook | #define MAX_OPTION_ROMS 16 |
136 | 2e55e842 | Gleb Natapov | typedef struct QEMUOptionRom { |
137 | 2e55e842 | Gleb Natapov | const char *name; |
138 | 2e55e842 | Gleb Natapov | int32_t bootindex; |
139 | 2e55e842 | Gleb Natapov | } QEMUOptionRom; |
140 | 2e55e842 | Gleb Natapov | extern QEMUOptionRom option_rom[MAX_OPTION_ROMS];
|
141 | 87ecb68b | pbrook | extern int nb_option_roms; |
142 | 87ecb68b | pbrook | |
143 | 87ecb68b | pbrook | #define MAX_PROM_ENVS 128 |
144 | 87ecb68b | pbrook | extern const char *prom_envs[MAX_PROM_ENVS]; |
145 | 87ecb68b | pbrook | extern unsigned int nb_prom_envs; |
146 | 87ecb68b | pbrook | |
147 | 6f338c34 | aliguori | /* pci-hotplug */
|
148 | 6c6a58ae | Markus Armbruster | void pci_device_hot_add(Monitor *mon, const QDict *qdict); |
149 | 4dbd84e2 | Markus Armbruster | int pci_drive_hot_add(Monitor *mon, const QDict *qdict, DriveInfo *dinfo); |
150 | b752daf0 | Markus Armbruster | void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict); |
151 | 6f338c34 | aliguori | |
152 | dd97aa8a | Alexander Graf | /* generic hotplug */
|
153 | dd97aa8a | Alexander Graf | void drive_hot_add(Monitor *mon, const QDict *qdict); |
154 | dd97aa8a | Alexander Graf | |
155 | 2ae63bda | Isaku Yamahata | /* pcie aer error injection */
|
156 | 2ae63bda | Isaku Yamahata | void pcie_aer_inject_error_print(Monitor *mon, const QObject *data); |
157 | 1f3392b7 | Zhi Yong Wu | int do_pcie_aer_inject_error(Monitor *mon,
|
158 | 2ae63bda | Isaku Yamahata | const QDict *qdict, QObject **ret_data);
|
159 | 2ae63bda | Isaku Yamahata | |
160 | 87ecb68b | pbrook | /* serial ports */
|
161 | 87ecb68b | pbrook | |
162 | 87ecb68b | pbrook | #define MAX_SERIAL_PORTS 4 |
163 | 87ecb68b | pbrook | |
164 | 87ecb68b | pbrook | extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
|
165 | 87ecb68b | pbrook | |
166 | 87ecb68b | pbrook | /* parallel ports */
|
167 | 87ecb68b | pbrook | |
168 | 87ecb68b | pbrook | #define MAX_PARALLEL_PORTS 3 |
169 | 87ecb68b | pbrook | |
170 | 87ecb68b | pbrook | extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
|
171 | 87ecb68b | pbrook | |
172 | d54908a5 | Luiz Capitulino | void do_usb_add(Monitor *mon, const QDict *qdict); |
173 | d54908a5 | Luiz Capitulino | void do_usb_del(Monitor *mon, const QDict *qdict); |
174 | 84f2d0ea | Wenchao Xia | void usb_info(Monitor *mon, const QDict *qdict); |
175 | 87ecb68b | pbrook | |
176 | 80cd3478 | Luiz Capitulino | void rtc_change_mon_event(struct tm *tm); |
177 | 80cd3478 | Luiz Capitulino | |
178 | aae9460e | Paul Brook | void register_devices(void); |
179 | aae9460e | Paul Brook | |
180 | 1ca4d09a | Gleb Natapov | void add_boot_device_path(int32_t bootindex, DeviceState *dev,
|
181 | 1ca4d09a | Gleb Natapov | const char *suffix); |
182 | 0e7a7592 | Markus Armbruster | char *get_boot_devices_list(size_t *size);
|
183 | 094b287f | zhlcindy@gmail.com | |
184 | 094b287f | zhlcindy@gmail.com | bool usb_enabled(bool default_usb); |
185 | 094b287f | zhlcindy@gmail.com | |
186 | 4d454574 | Paolo Bonzini | extern QemuOptsList qemu_drive_opts;
|
187 | 4d454574 | Paolo Bonzini | extern QemuOptsList qemu_chardev_opts;
|
188 | 4d454574 | Paolo Bonzini | extern QemuOptsList qemu_device_opts;
|
189 | 4d454574 | Paolo Bonzini | extern QemuOptsList qemu_netdev_opts;
|
190 | 4d454574 | Paolo Bonzini | extern QemuOptsList qemu_net_opts;
|
191 | 4d454574 | Paolo Bonzini | extern QemuOptsList qemu_global_opts;
|
192 | 4d454574 | Paolo Bonzini | extern QemuOptsList qemu_mon_opts;
|
193 | 4d454574 | Paolo Bonzini | |
194 | 87ecb68b | pbrook | #endif |