]>
Commit | Line | Data |
---|---|---|
376253ec AL |
1 | #ifndef MONITOR_H |
2 | #define MONITOR_H | |
3 | ||
4 | #include "qemu-common.h" | |
5 | #include "qemu-char.h" | |
d6f46833 | 6 | #include "qerror.h" |
cdb0def3 | 7 | #include "qdict.h" |
376253ec AL |
8 | #include "block.h" |
9 | ||
10 | extern Monitor *cur_mon; | |
8631b608 | 11 | extern Monitor *default_mon; |
376253ec | 12 | |
731b0364 AL |
13 | /* flags for monitor_init */ |
14 | #define MONITOR_IS_DEFAULT 0x01 | |
cde76ee1 | 15 | #define MONITOR_USE_READLINE 0x02 |
418173c7 | 16 | #define MONITOR_USE_CONTROL 0x04 |
39eaab9a | 17 | #define MONITOR_USE_PRETTY 0x08 |
731b0364 | 18 | |
8ac470c1 JK |
19 | /* flags for monitor commands */ |
20 | #define MONITOR_CMD_ASYNC 0x0001 | |
21 | ||
0d1ea871 LC |
22 | /* QMP events */ |
23 | typedef enum MonitorEvent { | |
242cd003 BS |
24 | QEVENT_SHUTDOWN, |
25 | QEVENT_RESET, | |
26 | QEVENT_POWERDOWN, | |
27 | QEVENT_STOP, | |
6ed2c484 | 28 | QEVENT_RESUME, |
586153d9 | 29 | QEVENT_VNC_CONNECTED, |
0d2ed46a | 30 | QEVENT_VNC_INITIALIZED, |
0d72f3d3 | 31 | QEVENT_VNC_DISCONNECTED, |
aa1db6ed | 32 | QEVENT_BLOCK_IO_ERROR, |
80cd3478 | 33 | QEVENT_RTC_CHANGE, |
9eedeb3b | 34 | QEVENT_WATCHDOG, |
6f8c63fb GH |
35 | QEVENT_SPICE_CONNECTED, |
36 | QEVENT_SPICE_INITIALIZED, | |
37 | QEVENT_SPICE_DISCONNECTED, | |
242cd003 | 38 | QEVENT_MAX, |
0d1ea871 LC |
39 | } MonitorEvent; |
40 | ||
6620d3ce MA |
41 | int monitor_cur_is_qmp(void); |
42 | ||
0d1ea871 | 43 | void monitor_protocol_event(MonitorEvent event, QObject *data); |
731b0364 | 44 | void monitor_init(CharDriverState *chr, int flags); |
376253ec | 45 | |
cde76ee1 | 46 | int monitor_suspend(Monitor *mon); |
376253ec AL |
47 | void monitor_resume(Monitor *mon); |
48 | ||
0bbc47bb LC |
49 | int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs, |
50 | BlockDriverCompletionFunc *completion_cb, | |
51 | void *opaque); | |
376253ec | 52 | |
7768e04c MM |
53 | int monitor_get_fd(Monitor *mon, const char *fdname); |
54 | ||
8b7968f7 SW |
55 | void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) |
56 | GCC_FMT_ATTR(2, 0); | |
e5924d89 | 57 | void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3); |
376253ec AL |
58 | void monitor_print_filename(Monitor *mon, const char *filename); |
59 | void monitor_flush(Monitor *mon); | |
b025c8b4 | 60 | int monitor_set_cpu(int cpu_index); |
99b7796f | 61 | int monitor_get_cpu_index(void); |
376253ec | 62 | |
940cc30d AL |
63 | typedef void (MonitorCompletion)(void *opaque, QObject *ret_data); |
64 | ||
d6f46833 MA |
65 | void monitor_set_error(Monitor *mon, QError *qerror); |
66 | ||
376253ec | 67 | #endif /* !MONITOR_H */ |