2009-03-05 23:01:23 +00:00
|
|
|
#ifndef MONITOR_H
|
|
|
|
#define MONITOR_H
|
|
|
|
|
|
|
|
#include "qemu-common.h"
|
2012-12-17 17:19:43 +00:00
|
|
|
#include "qapi/qmp/qdict.h"
|
2012-12-17 17:19:44 +00:00
|
|
|
#include "block/block.h"
|
2013-11-14 10:54:15 +00:00
|
|
|
#include "qemu/readline.h"
|
2009-03-05 23:01:23 +00:00
|
|
|
|
|
|
|
extern Monitor *cur_mon;
|
|
|
|
|
2009-03-05 23:01:42 +00:00
|
|
|
/* flags for monitor_init */
|
|
|
|
#define MONITOR_IS_DEFAULT 0x01
|
2009-03-05 23:01:51 +00:00
|
|
|
#define MONITOR_USE_READLINE 0x02
|
2009-11-27 00:58:51 +00:00
|
|
|
#define MONITOR_USE_CONTROL 0x04
|
2010-06-07 14:42:31 +00:00
|
|
|
#define MONITOR_USE_PRETTY 0x08
|
2009-03-05 23:01:42 +00:00
|
|
|
|
2015-03-06 19:01:05 +00:00
|
|
|
bool monitor_cur_is_qmp(void);
|
2010-02-11 16:05:43 +00:00
|
|
|
|
2009-03-05 23:01:42 +00:00
|
|
|
void monitor_init(CharDriverState *chr, int flags);
|
2009-03-05 23:01:23 +00:00
|
|
|
|
2009-03-05 23:01:51 +00:00
|
|
|
int monitor_suspend(Monitor *mon);
|
2009-03-05 23:01:23 +00:00
|
|
|
void monitor_resume(Monitor *mon);
|
|
|
|
|
2010-02-11 01:50:01 +00:00
|
|
|
int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
|
2014-10-07 11:59:15 +00:00
|
|
|
BlockCompletionFunc *completion_cb,
|
2010-02-11 01:50:01 +00:00
|
|
|
void *opaque);
|
2011-11-22 19:58:31 +00:00
|
|
|
int monitor_read_block_device_key(Monitor *mon, const char *device,
|
2014-10-07 11:59:15 +00:00
|
|
|
BlockCompletionFunc *completion_cb,
|
2011-11-22 19:58:31 +00:00
|
|
|
void *opaque);
|
2009-03-05 23:01:23 +00:00
|
|
|
|
2012-09-20 14:50:32 +00:00
|
|
|
int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp);
|
2015-02-09 13:03:19 +00:00
|
|
|
int monitor_fd_param(Monitor *mon, const char *fdname, Error **errp);
|
2009-07-22 08:11:41 +00:00
|
|
|
|
2010-09-23 19:28:05 +00:00
|
|
|
void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
|
|
|
|
GCC_FMT_ATTR(2, 0);
|
2010-09-23 19:28:03 +00:00
|
|
|
void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
|
2009-03-05 23:01:23 +00:00
|
|
|
void monitor_flush(Monitor *mon);
|
2011-10-06 17:02:57 +00:00
|
|
|
int monitor_set_cpu(int cpu_index);
|
2011-10-24 12:53:44 +00:00
|
|
|
int monitor_get_cpu_index(void);
|
2009-03-05 23:01:23 +00:00
|
|
|
|
2011-09-02 17:34:50 +00:00
|
|
|
void monitor_read_command(Monitor *mon, int show_prompt);
|
|
|
|
int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
|
|
|
|
void *opaque);
|
2010-02-17 09:52:26 +00:00
|
|
|
|
2013-12-20 22:21:10 +00:00
|
|
|
void object_add(const char *type, const char *id, const QDict *qdict,
|
|
|
|
Visitor *v, Error **errp);
|
2011-12-12 20:29:35 +00:00
|
|
|
|
2012-10-18 19:19:32 +00:00
|
|
|
AddfdInfo *monitor_fdset_add_fd(int fd, bool has_fdset_id, int64_t fdset_id,
|
|
|
|
bool has_opaque, const char *opaque,
|
|
|
|
Error **errp);
|
2012-08-14 20:43:47 +00:00
|
|
|
int monitor_fdset_get_fd(int64_t fdset_id, int flags);
|
|
|
|
int monitor_fdset_dup_fd_add(int64_t fdset_id, int dup_fd);
|
2014-08-17 09:45:17 +00:00
|
|
|
void monitor_fdset_dup_fd_remove(int dup_fd);
|
2012-08-14 20:43:47 +00:00
|
|
|
int monitor_fdset_dup_fd_find(int dup_fd);
|
|
|
|
|
2009-03-05 23:01:23 +00:00
|
|
|
#endif /* !MONITOR_H */
|