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/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;
|
|
|
|
|
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
|
|
|
|
2015-03-06 22:01:05 +03:00
|
|
|
bool monitor_cur_is_qmp(void);
|
2010-02-11 19:05:43 +03:00
|
|
|
|
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);
|
2015-02-09 16:03:19 +03:00
|
|
|
int monitor_fd_param(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);
|
2015-09-22 16:18:17 +03:00
|
|
|
int monitor_fprintf(FILE *stream, 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
|
|
|
|
2011-09-02 21:34:50 +04:00
|
|
|
void monitor_read_command(Monitor *mon, int show_prompt);
|
|
|
|
int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
|
|
|
|
void *opaque);
|
2010-02-17 12:52:26 +03: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 */
|