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