]>
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 |
731b0364 | 17 | |
0d1ea871 LC |
18 | /* QMP events */ |
19 | typedef enum MonitorEvent { | |
242cd003 BS |
20 | QEVENT_SHUTDOWN, |
21 | QEVENT_RESET, | |
22 | QEVENT_POWERDOWN, | |
23 | QEVENT_STOP, | |
6ed2c484 | 24 | QEVENT_RESUME, |
586153d9 | 25 | QEVENT_VNC_CONNECTED, |
0d2ed46a | 26 | QEVENT_VNC_INITIALIZED, |
0d72f3d3 | 27 | QEVENT_VNC_DISCONNECTED, |
aa1db6ed | 28 | QEVENT_BLOCK_IO_ERROR, |
80cd3478 | 29 | QEVENT_RTC_CHANGE, |
9eedeb3b | 30 | QEVENT_WATCHDOG, |
242cd003 | 31 | QEVENT_MAX, |
0d1ea871 LC |
32 | } MonitorEvent; |
33 | ||
6620d3ce MA |
34 | int monitor_cur_is_qmp(void); |
35 | ||
0d1ea871 | 36 | void monitor_protocol_event(MonitorEvent event, QObject *data); |
731b0364 | 37 | void monitor_init(CharDriverState *chr, int flags); |
376253ec | 38 | |
cde76ee1 | 39 | int monitor_suspend(Monitor *mon); |
376253ec AL |
40 | void monitor_resume(Monitor *mon); |
41 | ||
0bbc47bb LC |
42 | int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs, |
43 | BlockDriverCompletionFunc *completion_cb, | |
44 | void *opaque); | |
376253ec | 45 | |
7768e04c MM |
46 | int monitor_get_fd(Monitor *mon, const char *fdname); |
47 | ||
376253ec AL |
48 | void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap); |
49 | void monitor_printf(Monitor *mon, const char *fmt, ...) | |
50 | __attribute__ ((__format__ (__printf__, 2, 3))); | |
51 | void monitor_print_filename(Monitor *mon, const char *filename); | |
52 | void monitor_flush(Monitor *mon); | |
53 | ||
940cc30d AL |
54 | typedef void (MonitorCompletion)(void *opaque, QObject *ret_data); |
55 | ||
d6f46833 MA |
56 | void monitor_set_error(Monitor *mon, QError *qerror); |
57 | ||
376253ec | 58 | #endif /* !MONITOR_H */ |