]> git.proxmox.com Git - qemu.git/blob - monitor.h
monitor: Separate "default monitor" and "current monitor" cleanly
[qemu.git] / monitor.h
1 #ifndef MONITOR_H
2 #define MONITOR_H
3
4 #include "qemu-common.h"
5 #include "qemu-char.h"
6 #include "qdict.h"
7 #include "block.h"
8
9 extern Monitor *cur_mon;
10 extern Monitor *default_mon;
11
12 /* flags for monitor_init */
13 #define MONITOR_IS_DEFAULT 0x01
14 #define MONITOR_USE_READLINE 0x02
15 #define MONITOR_USE_CONTROL 0x04
16
17 /* QMP events */
18 typedef enum MonitorEvent {
19 QEVENT_SHUTDOWN,
20 QEVENT_RESET,
21 QEVENT_POWERDOWN,
22 QEVENT_STOP,
23 QEVENT_VNC_CONNECTED,
24 QEVENT_VNC_INITIALIZED,
25 QEVENT_VNC_DISCONNECTED,
26 QEVENT_BLOCK_IO_ERROR,
27 QEVENT_RTC_CHANGE,
28 QEVENT_WATCHDOG,
29 QEVENT_MAX,
30 } MonitorEvent;
31
32 void monitor_protocol_event(MonitorEvent event, QObject *data);
33 void monitor_init(CharDriverState *chr, int flags);
34
35 int monitor_suspend(Monitor *mon);
36 void monitor_resume(Monitor *mon);
37
38 int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
39 BlockDriverCompletionFunc *completion_cb,
40 void *opaque);
41
42 int monitor_get_fd(Monitor *mon, const char *fdname);
43
44 void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap);
45 void monitor_printf(Monitor *mon, const char *fmt, ...)
46 __attribute__ ((__format__ (__printf__, 2, 3)));
47 void monitor_print_filename(Monitor *mon, const char *filename);
48 void monitor_flush(Monitor *mon);
49
50 typedef void (MonitorCompletion)(void *opaque, QObject *ret_data);
51
52 #endif /* !MONITOR_H */