]>
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, |
2fdd16e2 | 46 | QEVENT_SPICE_MIGRATE_COMPLETED, |
4860853d DB |
47 | |
48 | /* Add to 'monitor_event_names' array in monitor.c when | |
49 | * defining new events here */ | |
50 | ||
242cd003 | 51 | QEVENT_MAX, |
0d1ea871 LC |
52 | } MonitorEvent; |
53 | ||
6620d3ce MA |
54 | int monitor_cur_is_qmp(void); |
55 | ||
0d1ea871 | 56 | void monitor_protocol_event(MonitorEvent event, QObject *data); |
731b0364 | 57 | void monitor_init(CharDriverState *chr, int flags); |
376253ec | 58 | |
cde76ee1 | 59 | int monitor_suspend(Monitor *mon); |
376253ec AL |
60 | void monitor_resume(Monitor *mon); |
61 | ||
0bbc47bb LC |
62 | int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs, |
63 | BlockDriverCompletionFunc *completion_cb, | |
64 | void *opaque); | |
e42e818b LC |
65 | int monitor_read_block_device_key(Monitor *mon, const char *device, |
66 | BlockDriverCompletionFunc *completion_cb, | |
67 | void *opaque); | |
376253ec | 68 | |
7768e04c | 69 | int monitor_get_fd(Monitor *mon, const char *fdname); |
a96ed02f | 70 | int monitor_handle_fd_param(Monitor *mon, const char *fdname); |
7768e04c | 71 | |
8b7968f7 SW |
72 | void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) |
73 | GCC_FMT_ATTR(2, 0); | |
e5924d89 | 74 | void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3); |
376253ec AL |
75 | void monitor_print_filename(Monitor *mon, const char *filename); |
76 | void monitor_flush(Monitor *mon); | |
b025c8b4 | 77 | int monitor_set_cpu(int cpu_index); |
99b7796f | 78 | int monitor_get_cpu_index(void); |
376253ec | 79 | |
940cc30d AL |
80 | typedef void (MonitorCompletion)(void *opaque, QObject *ret_data); |
81 | ||
d6f46833 | 82 | void monitor_set_error(Monitor *mon, QError *qerror); |
7060b478 AL |
83 | void monitor_read_command(Monitor *mon, int show_prompt); |
84 | ReadLineState *monitor_get_rs(Monitor *mon); | |
85 | int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func, | |
86 | void *opaque); | |
d6f46833 | 87 | |
eb6e8ea5 AL |
88 | int qmp_qom_set(Monitor *mon, const QDict *qdict, QObject **ret); |
89 | ||
90 | int qmp_qom_get(Monitor *mon, const QDict *qdict, QObject **ret); | |
91 | ||
adb696f3 CB |
92 | int monitor_fdset_get_fd(int64_t fdset_id, int flags); |
93 | int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd); | |
94 | int monitor_fdset_dup_fd_remove(int dup_fd); | |
95 | int monitor_fdset_dup_fd_find(int dup_fd); | |
96 | ||
376253ec | 97 | #endif /* !MONITOR_H */ |