mirror of
https://github.com/mii443/qemu.git
synced 2025-12-16 17:18:49 +00:00
QMP: Add QEMU's version to the greeting message
With capability negotiation support clients will only have a chance to check QEMU's version (ie. issue 'query-version') after the negotiation procedure is done. It might be useful to clients to check QEMU's version before negotiating features, though. To allow that, this commit adds the QEMU's version object to the greeting message. Not really sure this is needed, but doesn't hurt anyway. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
committed by
Anthony Liguori
parent
4ab4183d76
commit
ca9567e234
10
monitor.c
10
monitor.c
@@ -4368,6 +4368,14 @@ void monitor_resume(Monitor *mon)
|
||||
readline_show_prompt(mon->rs);
|
||||
}
|
||||
|
||||
static QObject *get_qmp_greeting(void)
|
||||
{
|
||||
QObject *ver;
|
||||
|
||||
do_info_version(NULL, &ver);
|
||||
return qobject_from_jsonf("{'QMP':{'version': %p,'capabilities': []}}",ver);
|
||||
}
|
||||
|
||||
/**
|
||||
* monitor_control_event(): Print QMP gretting
|
||||
*/
|
||||
@@ -4379,7 +4387,7 @@ static void monitor_control_event(void *opaque, int event)
|
||||
|
||||
json_message_parser_init(&mon->mc->parser, handle_qmp_command);
|
||||
|
||||
data = qobject_from_jsonf("{ 'QMP': { 'capabilities': [] } }");
|
||||
data = get_qmp_greeting();
|
||||
assert(data != NULL);
|
||||
|
||||
monitor_json_emitter(mon, data);
|
||||
|
||||
Reference in New Issue
Block a user