]> git.proxmox.com Git - qemu.git/blame - monitor.h
blockdev: Fix regression in -drive if=scsi,index=N
[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
AL
8#include "block.h"
9
10extern Monitor *cur_mon;
8631b608 11extern 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
39eaab9a 17#define MONITOR_USE_PRETTY 0x08
731b0364 18
8ac470c1
JK
19/* flags for monitor commands */
20#define MONITOR_CMD_ASYNC 0x0001
21
0d1ea871
LC
22/* QMP events */
23typedef 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,
6f8c63fb
GH
35 QEVENT_SPICE_CONNECTED,
36 QEVENT_SPICE_INITIALIZED,
37 QEVENT_SPICE_DISCONNECTED,
242cd003 38 QEVENT_MAX,
0d1ea871
LC
39} MonitorEvent;
40
6620d3ce
MA
41int monitor_cur_is_qmp(void);
42
0d1ea871 43void monitor_protocol_event(MonitorEvent event, QObject *data);
731b0364 44void monitor_init(CharDriverState *chr, int flags);
376253ec 45
cde76ee1 46int monitor_suspend(Monitor *mon);
376253ec
AL
47void monitor_resume(Monitor *mon);
48
0bbc47bb
LC
49int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
50 BlockDriverCompletionFunc *completion_cb,
51 void *opaque);
376253ec 52
7768e04c
MM
53int monitor_get_fd(Monitor *mon, const char *fdname);
54
8b7968f7
SW
55void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
56 GCC_FMT_ATTR(2, 0);
e5924d89 57void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
376253ec
AL
58void monitor_print_filename(Monitor *mon, const char *filename);
59void monitor_flush(Monitor *mon);
60
940cc30d
AL
61typedef void (MonitorCompletion)(void *opaque, QObject *ret_data);
62
d6f46833
MA
63void monitor_set_error(Monitor *mon, QError *qerror);
64
376253ec 65#endif /* !MONITOR_H */