blob: 851fd336660508645369c578bb75d00804241a6b [file] [log] [blame]
aliguori376253e2009-03-05 23:01:23 +00001#ifndef MONITOR_H
2#define MONITOR_H
3
4#include "qemu-common.h"
5#include "qemu-char.h"
Luiz Capitulinocdb0def2009-08-28 15:27:11 -03006#include "qdict.h"
aliguori376253e2009-03-05 23:01:23 +00007#include "block.h"
8
9extern Monitor *cur_mon;
10
aliguori731b0362009-03-05 23:01:42 +000011/* flags for monitor_init */
12#define MONITOR_IS_DEFAULT 0x01
aliguoricde76ee2009-03-05 23:01:51 +000013#define MONITOR_USE_READLINE 0x02
Luiz Capitulino418173c2009-11-26 22:58:51 -020014#define MONITOR_USE_CONTROL 0x04
aliguori731b0362009-03-05 23:01:42 +000015
Luiz Capitulino0d1ea872009-11-26 22:59:03 -020016/* QMP events */
17typedef enum MonitorEvent {
Luiz Capitulinob1a15e72009-11-26 22:59:04 -020018 EVENT_DEBUG,
19 EVENT_SHUTDOWN,
20 EVENT_RESET,
21 EVENT_POWERDOWN,
22 EVENT_STOP,
Luiz Capitulino0d1ea872009-11-26 22:59:03 -020023 EVENT_MAX,
24} MonitorEvent;
25
26void monitor_protocol_event(MonitorEvent event, QObject *data);
Luiz Capitulinoadcb1812009-11-26 22:58:52 -020027const char *monitor_cmdline_parse(const char *cmdline, int *flags);
aliguori731b0362009-03-05 23:01:42 +000028void monitor_init(CharDriverState *chr, int flags);
aliguori376253e2009-03-05 23:01:23 +000029
aliguoricde76ee2009-03-05 23:01:51 +000030int monitor_suspend(Monitor *mon);
aliguori376253e2009-03-05 23:01:23 +000031void monitor_resume(Monitor *mon);
32
33void monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
34 BlockDriverCompletionFunc *completion_cb,
35 void *opaque);
36
Mark McLoughlin7768e042009-07-22 09:11:41 +010037int monitor_get_fd(Monitor *mon, const char *fdname);
38
aliguori376253e2009-03-05 23:01:23 +000039void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap);
40void monitor_printf(Monitor *mon, const char *fmt, ...)
41 __attribute__ ((__format__ (__printf__, 2, 3)));
42void monitor_print_filename(Monitor *mon, const char *filename);
43void monitor_flush(Monitor *mon);
44
45#endif /* !MONITOR_H */