]>
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 | 8 | #include "block.h" |
7060b478 | 9 | #include "readline.h" |
376253ec AL |
10 | |
11 | extern Monitor *cur_mon; | |
8631b608 | 12 | extern Monitor *default_mon; |
376253ec | 13 | |
731b0364 AL |
14 | /* flags for monitor_init */ |
15 | #define MONITOR_IS_DEFAULT 0x01 | |
cde76ee1 | 16 | #define MONITOR_USE_READLINE 0x02 |
418173c7 | 17 | #define MONITOR_USE_CONTROL 0x04 |
39eaab9a | 18 | #define MONITOR_USE_PRETTY 0x08 |
731b0364 | 19 | |
8ac470c1 JK |
20 | /* flags for monitor commands */ |
21 | #define MONITOR_CMD_ASYNC 0x0001 | |
22 | ||
0d1ea871 LC |
23 | /* QMP events */ |
24 | typedef enum MonitorEvent { | |
242cd003 BS |
25 | QEVENT_SHUTDOWN, |
26 | QEVENT_RESET, | |
27 | QEVENT_POWERDOWN, | |
28 | QEVENT_STOP, | |
6ed2c484 | 29 | QEVENT_RESUME, |
586153d9 | 30 | QEVENT_VNC_CONNECTED, |
0d2ed46a | 31 | QEVENT_VNC_INITIALIZED, |
0d72f3d3 | 32 | QEVENT_VNC_DISCONNECTED, |
aa1db6ed | 33 | QEVENT_BLOCK_IO_ERROR, |
80cd3478 | 34 | QEVENT_RTC_CHANGE, |
9eedeb3b | 35 | QEVENT_WATCHDOG, |
6f8c63fb GH |
36 | QEVENT_SPICE_CONNECTED, |
37 | QEVENT_SPICE_INITIALIZED, | |
38 | QEVENT_SPICE_DISCONNECTED, | |
12bd451f | 39 | QEVENT_BLOCK_JOB_COMPLETED, |
370521a1 | 40 | QEVENT_BLOCK_JOB_CANCELLED, |
6f382ed2 | 41 | QEVENT_DEVICE_TRAY_MOVED, |
53370b78 | 42 | QEVENT_SUSPEND, |
25df49f6 | 43 | QEVENT_SUSPEND_DISK, |
53370b78 | 44 | QEVENT_WAKEUP, |
973603a8 | 45 | QEVENT_BALLOON_CHANGE, |
4860853d DB |
46 | |
47 | /* Add to 'monitor_event_names' array in monitor.c when | |
48 | * defining new events here */ | |
49 | ||
242cd003 | 50 | QEVENT_MAX, |
0d1ea871 LC |
51 | } MonitorEvent; |
52 | ||
6620d3ce MA |
53 | int monitor_cur_is_qmp(void); |
54 | ||
0d1ea871 | 55 | void monitor_protocol_event(MonitorEvent event, QObject *data); |
731b0364 | 56 | void monitor_init(CharDriverState *chr, int flags); |
376253ec | 57 | |
cde76ee1 | 58 | int monitor_suspend(Monitor *mon); |
376253ec AL |
59 | void monitor_resume(Monitor *mon); |
60 | ||
0bbc47bb LC |
61 | int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs, |
62 | BlockDriverCompletionFunc *completion_cb, | |
63 | void *opaque); | |
e42e818b LC |
64 | int monitor_read_block_device_key(Monitor *mon, const char *device, |
65 | BlockDriverCompletionFunc *completion_cb, | |
66 | void *opaque); | |
376253ec | 67 | |
7768e04c MM |
68 | int monitor_get_fd(Monitor *mon, const char *fdname); |
69 | ||
8b7968f7 SW |
70 | void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) |
71 | GCC_FMT_ATTR(2, 0); | |
e5924d89 | 72 | void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3); |
376253ec AL |
73 | void monitor_print_filename(Monitor *mon, const char *filename); |
74 | void monitor_flush(Monitor *mon); | |
b025c8b4 | 75 | int monitor_set_cpu(int cpu_index); |
99b7796f | 76 | int monitor_get_cpu_index(void); |
376253ec | 77 | |
940cc30d AL |
78 | typedef void (MonitorCompletion)(void *opaque, QObject *ret_data); |
79 | ||
d6f46833 | 80 | void monitor_set_error(Monitor *mon, QError *qerror); |
7060b478 AL |
81 | void monitor_read_command(Monitor *mon, int show_prompt); |
82 | ReadLineState *monitor_get_rs(Monitor *mon); | |
83 | int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func, | |
84 | void *opaque); | |
d6f46833 | 85 | |
eb6e8ea5 AL |
86 | int qmp_qom_set(Monitor *mon, const QDict *qdict, QObject **ret); |
87 | ||
88 | int qmp_qom_get(Monitor *mon, const QDict *qdict, QObject **ret); | |
89 | ||
adb696f3 CB |
90 | int monitor_fdset_get_fd(int64_t fdset_id, int flags); |
91 | int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd); | |
92 | int monitor_fdset_dup_fd_remove(int dup_fd); | |
93 | int monitor_fdset_dup_fd_find(int dup_fd); | |
94 | ||
376253ec | 95 | #endif /* !MONITOR_H */ |