diff options
-rw-r--r-- | monitor.c | 11 | ||||
-rw-r--r-- | qemu-monitor.hx | 14 |
2 files changed, 25 insertions, 0 deletions
@@ -122,6 +122,7 @@ typedef struct MonitorControl { QObject *id; int print_enabled; JSONMessageParser parser; + int command_mode; } MonitorControl; struct Monitor { @@ -412,6 +413,15 @@ void monitor_protocol_event(MonitorEvent event, QObject *data) QDECREF(qmp); } +static void do_qmp_capabilities(Monitor *mon, const QDict *params, + QObject **ret_data) +{ + /* Will setup QMP capabilities in the future */ + if (monitor_ctrl_mode(mon)) { + mon->mc->command_mode = 1; + } +} + static int compare_cmd(const char *name, const char *list) { const char *p, *pstart; @@ -4385,6 +4395,7 @@ static void monitor_control_event(void *opaque, int event) QObject *data; Monitor *mon = opaque; + mon->mc->command_mode = 0; json_message_parser_init(&mon->mc->parser, handle_qmp_command); data = get_qmp_greeting(); diff --git a/qemu-monitor.hx b/qemu-monitor.hx index cf9e430b58..7f9d261cd9 100644 --- a/qemu-monitor.hx +++ b/qemu-monitor.hx @@ -1126,6 +1126,20 @@ STEXI Set the encrypted device @var{device} password to @var{password} ETEXI + { + .name = "qmp_capabilities", + .args_type = "", + .params = "", + .help = "enable QMP capabilities", + .user_print = monitor_user_noop, + .mhandler.cmd_new = do_qmp_capabilities, + }, + +STEXI +@item qmp_capabilities +Enable the specified QMP capabilities +ETEXI + STEXI @end table ETEXI |