root / sysemu.h @ 0834c9ea
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 | 376253ec | aliguori | #include "qemu-common.h" |
6 | 62c5802e | Gerd Hoffmann | #include "qemu-option.h" |
7 | 72cf2d4f | Blue Swirl | #include "qemu-queue.h" |
8 | 6875204c | Jan Kiszka | #include "qemu-timer.h" |
9 | 1fa9a5e4 | Luiz Capitulino | #include "qapi-types.h" |
10 | fd42deeb | Gerd Hoffmann | #include "notify.h" |
11 | 44a9b356 | Paolo Bonzini | #include "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 | 5db9d4d1 | Luiz Capitulino | void runstate_init(void); |
23 | f5bbfba1 | Luiz Capitulino | bool runstate_check(RunState state);
|
24 | f5bbfba1 | Luiz Capitulino | void runstate_set(RunState new_state);
|
25 | 1354869c | Luiz Capitulino | int runstate_is_running(void); |
26 | 87ecb68b | pbrook | typedef struct vm_change_state_entry VMChangeStateEntry; |
27 | 1dfb4dd9 | Luiz Capitulino | typedef void VMChangeStateHandler(void *opaque, int running, RunState state); |
28 | 87ecb68b | pbrook | |
29 | 87ecb68b | pbrook | VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb, |
30 | 87ecb68b | pbrook | void *opaque);
|
31 | 87ecb68b | pbrook | void qemu_del_vm_change_state_handler(VMChangeStateEntry *e);
|
32 | 1dfb4dd9 | Luiz Capitulino | void vm_state_notify(int running, RunState state); |
33 | e07bbac5 | Jan Kiszka | |
34 | e063eb1f | Jan Kiszka | #define VMRESET_SILENT false |
35 | e063eb1f | Jan Kiszka | #define VMRESET_REPORT true |
36 | e063eb1f | Jan Kiszka | |
37 | 87ecb68b | pbrook | void vm_start(void); |
38 | 1dfb4dd9 | Luiz Capitulino | void vm_stop(RunState state);
|
39 | 8a9236f1 | Luiz Capitulino | void vm_stop_force_state(RunState state);
|
40 | 87ecb68b | pbrook | |
41 | 95b363b5 | Gerd Hoffmann | typedef enum WakeupReason { |
42 | 95b363b5 | Gerd Hoffmann | QEMU_WAKEUP_REASON_OTHER = 0,
|
43 | 62aeb0f7 | Gerd Hoffmann | QEMU_WAKEUP_REASON_RTC, |
44 | 6595abc0 | Gerd Hoffmann | QEMU_WAKEUP_REASON_PMTIMER, |
45 | 95b363b5 | Gerd Hoffmann | } WakeupReason; |
46 | 95b363b5 | Gerd Hoffmann | |
47 | 87ecb68b | pbrook | void qemu_system_reset_request(void); |
48 | 95b363b5 | Gerd Hoffmann | void qemu_system_suspend_request(void); |
49 | 95b363b5 | Gerd Hoffmann | void qemu_register_suspend_notifier(Notifier *notifier);
|
50 | 95b363b5 | Gerd Hoffmann | void qemu_system_wakeup_request(WakeupReason reason);
|
51 | 95b363b5 | Gerd Hoffmann | void qemu_system_wakeup_enable(WakeupReason reason, bool enabled); |
52 | 95b363b5 | Gerd Hoffmann | void qemu_register_wakeup_notifier(Notifier *notifier);
|
53 | 87ecb68b | pbrook | void qemu_system_shutdown_request(void); |
54 | 87ecb68b | pbrook | void qemu_system_powerdown_request(void); |
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 | cf7a2fe2 | aurel32 | int qemu_shutdown_requested(void); |
60 | cf7a2fe2 | aurel32 | int qemu_reset_requested(void); |
61 | cf7a2fe2 | aurel32 | int qemu_powerdown_requested(void); |
62 | f64622c4 | Gleb Natapov | void qemu_system_killed(int signal, pid_t pid); |
63 | f64622c4 | Gleb Natapov | void qemu_kill_report(void); |
64 | d9c32310 | Blue Swirl | extern qemu_irq qemu_system_powerdown;
|
65 | be522029 | David Gibson | void qemu_devices_reset(void); |
66 | e063eb1f | Jan Kiszka | void qemu_system_reset(bool report); |
67 | 87ecb68b | pbrook | |
68 | fd42deeb | Gerd Hoffmann | void qemu_add_exit_notifier(Notifier *notify);
|
69 | fd42deeb | Gerd Hoffmann | void qemu_remove_exit_notifier(Notifier *notify);
|
70 | fd42deeb | Gerd Hoffmann | |
71 | 4cab946a | Gleb Natapov | void qemu_add_machine_init_done_notifier(Notifier *notify);
|
72 | 4cab946a | Gleb Natapov | |
73 | d54908a5 | Luiz Capitulino | void do_savevm(Monitor *mon, const QDict *qdict); |
74 | 03cd4655 | Markus Armbruster | int load_vmstate(const char *name); |
75 | d54908a5 | Luiz Capitulino | void do_delvm(Monitor *mon, const QDict *qdict); |
76 | 376253ec | aliguori | void do_info_snapshots(Monitor *mon);
|
77 | 87ecb68b | pbrook | |
78 | 210f41ba | aliguori | void qemu_announce_self(void); |
79 | 210f41ba | aliguori | |
80 | e1c37d0e | Luiz Capitulino | bool qemu_savevm_state_blocked(Error **errp);
|
81 | 6607ae23 | Isaku Yamahata | int qemu_savevm_state_begin(QEMUFile *f,
|
82 | 6607ae23 | Isaku Yamahata | const MigrationParams *params);
|
83 | 539de124 | Luiz Capitulino | int qemu_savevm_state_iterate(QEMUFile *f);
|
84 | 539de124 | Luiz Capitulino | int qemu_savevm_state_complete(QEMUFile *f);
|
85 | 539de124 | Luiz Capitulino | void qemu_savevm_state_cancel(QEMUFile *f);
|
86 | 9366f418 | aliguori | int qemu_loadvm_state(QEMUFile *f);
|
87 | 9366f418 | aliguori | |
88 | 87ecb68b | pbrook | /* SLIRP */
|
89 | 376253ec | aliguori | void do_info_slirp(Monitor *mon);
|
90 | 87ecb68b | pbrook | |
91 | 993fbfdb | Anthony Liguori | typedef enum DisplayType |
92 | 993fbfdb | Anthony Liguori | { |
93 | 993fbfdb | Anthony Liguori | DT_DEFAULT, |
94 | 993fbfdb | Anthony Liguori | DT_CURSES, |
95 | 993fbfdb | Anthony Liguori | DT_SDL, |
96 | 993fbfdb | Anthony Liguori | DT_NOGRAPHIC, |
97 | 4171d32e | Jes Sorensen | DT_NONE, |
98 | 993fbfdb | Anthony Liguori | } DisplayType; |
99 | 993fbfdb | Anthony Liguori | |
100 | d399f677 | Paolo Bonzini | extern int autostart; |
101 | 87ecb68b | pbrook | extern int bios_size; |
102 | 86176759 | Zachary Amsden | |
103 | 86176759 | Zachary Amsden | typedef enum { |
104 | a19cbfb3 | Gerd Hoffmann | VGA_NONE, VGA_STD, VGA_CIRRUS, VGA_VMWARE, VGA_XENFB, VGA_QXL, |
105 | 86176759 | Zachary Amsden | } VGAInterfaceType; |
106 | 86176759 | Zachary Amsden | |
107 | 86176759 | Zachary Amsden | extern int vga_interface_type; |
108 | 86176759 | Zachary Amsden | #define cirrus_vga_enabled (vga_interface_type == VGA_CIRRUS)
|
109 | 86176759 | Zachary Amsden | #define std_vga_enabled (vga_interface_type == VGA_STD)
|
110 | 86176759 | Zachary Amsden | #define xenfb_enabled (vga_interface_type == VGA_XENFB)
|
111 | 86176759 | Zachary Amsden | #define vmsvga_enabled (vga_interface_type == VGA_VMWARE)
|
112 | a19cbfb3 | Gerd Hoffmann | #define qxl_enabled (vga_interface_type == VGA_QXL)
|
113 | 86176759 | Zachary Amsden | |
114 | 87ecb68b | pbrook | extern int graphic_width; |
115 | 87ecb68b | pbrook | extern int graphic_height; |
116 | 87ecb68b | pbrook | extern int graphic_depth; |
117 | 993fbfdb | Anthony Liguori | extern DisplayType display_type;
|
118 | 87ecb68b | pbrook | extern const char *keyboard_layout; |
119 | 87ecb68b | pbrook | extern int win2k_install_hack; |
120 | 87ecb68b | pbrook | extern int alt_grab; |
121 | 0ca9f8a4 | Dustin Kirkland | extern int ctrl_grab; |
122 | 87ecb68b | pbrook | extern int usb_enabled; |
123 | 87ecb68b | pbrook | extern int smp_cpus; |
124 | 6be68d7e | Jes Sorensen | extern int max_cpus; |
125 | 87ecb68b | pbrook | extern int cursor_hide; |
126 | 87ecb68b | pbrook | extern int graphic_rotate; |
127 | 87ecb68b | pbrook | extern int no_quit; |
128 | a691d41a | Luiz Capitulino | extern int no_shutdown; |
129 | 87ecb68b | pbrook | extern int semihosting_enabled; |
130 | 87ecb68b | pbrook | extern int old_param; |
131 | 95387491 | Jan Kiszka | extern int boot_menu; |
132 | 3d3b8303 | wayne | extern uint8_t *boot_splash_filedata;
|
133 | 3d3b8303 | wayne | extern int boot_splash_filedata_size; |
134 | 3d3b8303 | wayne | extern uint8_t qemu_extra_params_fw[2]; |
135 | 6875204c | Jan Kiszka | extern QEMUClock *rtc_clock;
|
136 | 87ecb68b | pbrook | |
137 | 268a362c | aliguori | #define MAX_NODES 64 |
138 | ee785fed | Chegu Vinod | #define MAX_CPUMASK_BITS 255 |
139 | 268a362c | aliguori | extern int nb_numa_nodes; |
140 | 268a362c | aliguori | extern uint64_t node_mem[MAX_NODES];
|
141 | ee785fed | Chegu Vinod | extern unsigned long *node_cpumask[MAX_NODES]; |
142 | 268a362c | aliguori | |
143 | 87ecb68b | pbrook | #define MAX_OPTION_ROMS 16 |
144 | 2e55e842 | Gleb Natapov | typedef struct QEMUOptionRom { |
145 | 2e55e842 | Gleb Natapov | const char *name; |
146 | 2e55e842 | Gleb Natapov | int32_t bootindex; |
147 | 2e55e842 | Gleb Natapov | } QEMUOptionRom; |
148 | 2e55e842 | Gleb Natapov | extern QEMUOptionRom option_rom[MAX_OPTION_ROMS];
|
149 | 87ecb68b | pbrook | extern int nb_option_roms; |
150 | 87ecb68b | pbrook | |
151 | 87ecb68b | pbrook | #define MAX_PROM_ENVS 128 |
152 | 87ecb68b | pbrook | extern const char *prom_envs[MAX_PROM_ENVS]; |
153 | 87ecb68b | pbrook | extern unsigned int nb_prom_envs; |
154 | 87ecb68b | pbrook | |
155 | 6f338c34 | aliguori | /* pci-hotplug */
|
156 | 6c6a58ae | Markus Armbruster | void pci_device_hot_add(Monitor *mon, const QDict *qdict); |
157 | dd97aa8a | Alexander Graf | int pci_drive_hot_add(Monitor *mon, const QDict *qdict, |
158 | dd97aa8a | Alexander Graf | DriveInfo *dinfo, int type);
|
159 | b752daf0 | Markus Armbruster | void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict); |
160 | 6f338c34 | aliguori | |
161 | dd97aa8a | Alexander Graf | /* generic hotplug */
|
162 | dd97aa8a | Alexander Graf | void drive_hot_add(Monitor *mon, const QDict *qdict); |
163 | dd97aa8a | Alexander Graf | |
164 | 2ae63bda | Isaku Yamahata | /* pcie aer error injection */
|
165 | 2ae63bda | Isaku Yamahata | void pcie_aer_inject_error_print(Monitor *mon, const QObject *data); |
166 | 1f3392b7 | Zhi Yong Wu | int do_pcie_aer_inject_error(Monitor *mon,
|
167 | 2ae63bda | Isaku Yamahata | const QDict *qdict, QObject **ret_data);
|
168 | 2ae63bda | Isaku Yamahata | |
169 | 87ecb68b | pbrook | /* serial ports */
|
170 | 87ecb68b | pbrook | |
171 | 87ecb68b | pbrook | #define MAX_SERIAL_PORTS 4 |
172 | 87ecb68b | pbrook | |
173 | 87ecb68b | pbrook | extern CharDriverState *serial_hds[MAX_SERIAL_PORTS];
|
174 | 87ecb68b | pbrook | |
175 | 87ecb68b | pbrook | /* parallel ports */
|
176 | 87ecb68b | pbrook | |
177 | 87ecb68b | pbrook | #define MAX_PARALLEL_PORTS 3 |
178 | 87ecb68b | pbrook | |
179 | 87ecb68b | pbrook | extern CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
|
180 | 87ecb68b | pbrook | |
181 | d54908a5 | Luiz Capitulino | void do_usb_add(Monitor *mon, const QDict *qdict); |
182 | d54908a5 | Luiz Capitulino | void do_usb_del(Monitor *mon, const QDict *qdict); |
183 | 376253ec | aliguori | void usb_info(Monitor *mon);
|
184 | 87ecb68b | pbrook | |
185 | 80cd3478 | Luiz Capitulino | void rtc_change_mon_event(struct tm *tm); |
186 | 80cd3478 | Luiz Capitulino | |
187 | aae9460e | Paul Brook | void register_devices(void); |
188 | aae9460e | Paul Brook | |
189 | 1ca4d09a | Gleb Natapov | void add_boot_device_path(int32_t bootindex, DeviceState *dev,
|
190 | 1ca4d09a | Gleb Natapov | const char *suffix); |
191 | 962630f2 | Gleb Natapov | char *get_boot_devices_list(uint32_t *size);
|
192 | 87ecb68b | pbrook | #endif |