2009-03-06 02:01:23 +03:00
|
|
|
#ifndef MONITOR_H
|
|
|
|
#define MONITOR_H
|
|
|
|
|
|
|
|
#include "qemu-common.h"
|
2012-12-17 21:19:43 +04:00
|
|
|
#include "qapi/qmp/qerror.h"
|
|
|
|
#include "qapi/qmp/qdict.h"
|
2012-12-17 21:19:44 +04:00
|
|
|
#include "block/block.h"
|
2013-11-14 14:54:15 +04:00
|
|
|
#include "qemu/readline.h"
|
2009-03-06 02:01:23 +03:00
|
|
|
|
|
|
|
extern Monitor *cur_mon;
|
2010-02-18 13:41:55 +03:00
|
|
|
extern Monitor *default_mon;
|
2009-03-06 02:01:23 +03:00
|
|
|
|
2009-03-06 02:01:42 +03:00
|
|
|
/* flags for monitor_init */
|
|
|
|
#define MONITOR_IS_DEFAULT 0x01
|
2009-03-06 02:01:51 +03:00
|
|
|
#define MONITOR_USE_READLINE 0x02
|
2009-11-27 03:58:51 +03:00
|
|
|
#define MONITOR_USE_CONTROL 0x04
|
2010-06-07 18:42:31 +04:00
|
|
|
#define MONITOR_USE_PRETTY 0x08
|
2009-03-06 02:01:42 +03:00
|
|
|
|
2010-06-16 02:38:39 +04:00
|
|
|
/* flags for monitor commands */
|
|
|
|
#define MONITOR_CMD_ASYNC 0x0001
|
|
|
|
|
2010-02-11 19:05:43 +03:00
|
|
|
int monitor_cur_is_qmp(void);
|
|
|
|
|
2009-03-06 02:01:42 +03:00
|
|
|
void monitor_init(CharDriverState *chr, int flags);
|
2009-03-06 02:01:23 +03:00
|
|
|
|
2009-03-06 02:01:51 +03:00
|
|
|
int monitor_suspend(Monitor *mon);
|
2009-03-06 02:01:23 +03:00
|
|
|
void monitor_resume(Monitor *mon);
|
|
|
|
|
2010-02-11 04:50:01 +03:00
|
|
|
int monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
|
2014-10-07 15:59:15 +04:00
|
|
|
BlockCompletionFunc *completion_cb,
|
2010-02-11 04:50:01 +03:00
|
|
|
void *opaque);
|
2011-11-22 23:58:31 +04:00
|
|
|
int monitor_read_block_device_key(Monitor *mon, const char *device,
|
2014-10-07 15:59:15 +04:00
|
|
|
BlockCompletionFunc *completion_cb,
|
2011-11-22 23:58:31 +04:00
|
|
|
void *opaque);
|
2009-03-06 02:01:23 +03:00
|
|
|
|
2012-09-20 18:50:32 +04:00
|
|
|
int monitor_get_fd(Monitor *mon, const char *fdname, Error **errp);
|
2012-08-22 00:52:07 +04:00
|
|
|
int monitor_handle_fd_param(Monitor *mon, const char *fdname);
|
2014-04-10 12:24:31 +04:00
|
|
|
int monitor_handle_fd_param2(Monitor *mon, const char *fdname, Error **errp);
|
2009-07-22 12:11:41 +04:00
|
|
|
|
2010-09-23 23:28:05 +04:00
|
|
|
void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap)
|
|
|
|
GCC_FMT_ATTR(2, 0);
|
2010-09-23 23:28:03 +04:00
|
|
|
void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
|
2009-03-06 02:01:23 +03:00
|
|
|
void monitor_flush(Monitor *mon);
|
2011-10-06 21:02:57 +04:00
|
|
|
int monitor_set_cpu(int cpu_index);
|
2011-10-24 16:53:44 +04:00
|
|
|
int monitor_get_cpu_index(void);
|
2009-03-06 02:01:23 +03:00
|
|
|
|
2010-01-25 21:18:44 +03:00
|
|
|
typedef void (MonitorCompletion)(void *opaque, QObject *ret_data);
|
|
|
|
|
2010-02-17 12:52:26 +03:00
|
|
|
void monitor_set_error(Monitor *mon, QError *qerror);
|
2011-09-02 21:34:50 +04:00
|
|
|
void monitor_read_command(Monitor *mon, int show_prompt);
|
|
|
|
ReadLineState *monitor_get_rs(Monitor *mon);
|
|
|
|
int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
|
|
|
|
void *opaque);
|
2010-02-17 12:52:26 +03:00
|
|
|
|
2011-12-13 00:29:35 +04:00
|
|
|
int qmp_qom_set(Monitor *mon, const QDict *qdict, QObject **ret);
|
|
|
|
|
|
|
|
int qmp_qom_get(Monitor *mon, const QDict *qdict, QObject **ret);
|
2013-12-21 02:21:10 +04:00
|
|
|
int qmp_object_add(Monitor *mon, const QDict *qdict, QObject **ret);
|
|
|
|
void object_add(const char *type, const char *id, const QDict *qdict,
|
|
|
|
Visitor *v, Error **errp);
|
2011-12-13 00:29:35 +04:00
|
|
|
|
2012-10-18 23:19:32 +04: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-15 00:43:47 +04: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 13:45:17 +04:00
|
|
|
void monitor_fdset_dup_fd_remove(int dup_fd);
|
2012-08-15 00:43:47 +04:00
|
|
|
int monitor_fdset_dup_fd_find(int dup_fd);
|
|
|
|
|
2009-03-06 02:01:23 +03:00
|
|
|
#endif /* !MONITOR_H */
|