diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2010-02-04 18:10:05 -0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-02-10 12:46:05 -0600 |
commit | 4a7e1190dfadf1154721125af8510347f8a3c56b (patch) | |
tree | 4a0c1bca3a4832dfc83019a932413b78bf81ad95 /monitor.c | |
parent | ca9567e23454ca94e3911710da4e953ad049b40f (diff) |
QMP: Introduce the qmp_capabilities command
This command will be used to enable QMP capabilities advertised
by the capabilities array.
Note that it will be mandatory to issue this command in order
to make QMP functional (although this behavior is not being
enforced by this commit).
Also, as we don't have any capabilities yet, the new command
doesn't accept any arguments. I will postpone the decision for
a format for this until we get our first capability.
Finally, this command is visible from the user Monitor too, in
the meaning that you can execute it but it won't do anything.
Making it only visible in QMP is beyond this series' goal, as
it requires changes in unrelated places.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 11 |
1 files changed, 11 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(); |