]>
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 | |
8ac470c1 JK |
18 | /* flags for monitor commands */ |
19 | #define MONITOR_CMD_ASYNC 0x0001 | |
a6c4d364 | 20 | #define MONITOR_CMD_USER_ONLY 0x0002 |
8ac470c1 | 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, |
242cd003 | 35 | QEVENT_MAX, |
0d1ea871 LC |
36 | } MonitorEvent; |
37 | ||
6620d3ce MA |
38 | int monitor_cur_is_qmp(void); |
39 | ||
0d1ea871 | 40 | void monitor_protocol_event(MonitorEvent event, QObject *data); |
731b0364 | 41 | void monitor_init(CharDriverState *chr, int flags); |
376253ec | 42 | |
cde76ee1 | 43 | int monitor_suspend(Monitor *mon); |
376253ec AL |
44 | void monitor_resume(Monitor *mon); |
45 | ||
0bbc47bb LC |
46 | int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs, |
47 | BlockDriverCompletionFunc *completion_cb, | |
48 | void *opaque); | |
376253ec | 49 | |
7768e04c MM |
50 | int monitor_get_fd(Monitor *mon, const char *fdname); |
51 | ||
376253ec AL |
52 | void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap); |
53 | void monitor_printf(Monitor *mon, const char *fmt, ...) | |
54 | __attribute__ ((__format__ (__printf__, 2, 3))); | |
55 | void monitor_print_filename(Monitor *mon, const char *filename); | |
56 | void monitor_flush(Monitor *mon); | |
57 | ||
940cc30d AL |
58 | typedef void (MonitorCompletion)(void *opaque, QObject *ret_data); |
59 | ||
d6f46833 MA |
60 | void monitor_set_error(Monitor *mon, QError *qerror); |
61 | ||
376253ec | 62 | #endif /* !MONITOR_H */ |