]> git.proxmox.com Git - qemu.git/blame - monitor.h
cleanup qemu_co_sendv(), qemu_co_recvv() and friends
[qemu.git] / monitor.h
CommitLineData
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
11extern Monitor *cur_mon;
8631b608 12extern 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 */
24typedef 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
GH
42 QEVENT_SUSPEND,
43 QEVENT_WAKEUP,
4860853d
DB
44
45 /* Add to 'monitor_event_names' array in monitor.c when
46 * defining new events here */
47
242cd003 48 QEVENT_MAX,
0d1ea871
LC
49} MonitorEvent;
50
6620d3ce
MA
51int monitor_cur_is_qmp(void);
52
0d1ea871 53void monitor_protocol_event(MonitorEvent event, QObject *data);
731b0364 54void monitor_init(CharDriverState *chr, int flags);
376253ec 55
cde76ee1 56int monitor_suspend(Monitor *mon);
376253ec
AL
57void monitor_resume(Monitor *mon);
58
0bbc47bb
LC
59int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
60 BlockDriverCompletionFunc *completion_cb,
61 void *opaque);
e42e818b
LC
62int monitor_read_block_device_key(Monitor *mon, const char *device,
63 BlockDriverCompletionFunc *completion_cb,
64 void *opaque);
376253ec 65
7768e04c
MM
66int monitor_get_fd(Monitor *mon, const char *fdname);
67
8b7968f7
SW
68void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
69 GCC_FMT_ATTR(2, 0);
e5924d89 70void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
376253ec
AL
71void monitor_print_filename(Monitor *mon, const char *filename);
72void monitor_flush(Monitor *mon);
b025c8b4 73int monitor_set_cpu(int cpu_index);
99b7796f 74int monitor_get_cpu_index(void);
376253ec 75
940cc30d
AL
76typedef void (MonitorCompletion)(void *opaque, QObject *ret_data);
77
d6f46833 78void monitor_set_error(Monitor *mon, QError *qerror);
7060b478
AL
79void monitor_read_command(Monitor *mon, int show_prompt);
80ReadLineState *monitor_get_rs(Monitor *mon);
81int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
82 void *opaque);
d6f46833 83
eb6e8ea5
AL
84int qmp_qom_set(Monitor *mon, const QDict *qdict, QObject **ret);
85
86int qmp_qom_get(Monitor *mon, const QDict *qdict, QObject **ret);
87
376253ec 88#endif /* !MONITOR_H */