Revision ca9567e2
b/QMP/README | ||
---|---|---|
52 | 52 |
Trying 127.0.0.1... |
53 | 53 |
Connected to localhost. |
54 | 54 |
Escape character is '^]'. |
55 |
{"QMP": {"capabilities": []}} |
|
55 |
{"QMP": {"version": {"qemu": "0.12.50", "package": ""}, "capabilities": []}} |
|
56 |
{ "execute": "qmp_capabilities" } |
|
57 |
{"return": {}} |
|
56 | 58 |
{ "execute": "query-version" } |
57 |
{"return": {"qemu": "0.11.50", "package": ""}}
|
|
59 |
{"return": {"qemu": "0.12.50", "package": ""}}
|
|
58 | 60 |
|
59 | 61 |
Contact |
60 | 62 |
------- |
b/QMP/qmp-spec.txt | ||
---|---|---|
48 | 48 |
|
49 | 49 |
The format is: |
50 | 50 |
|
51 |
{ "QMP": { "capabilities": json-array } } |
|
51 |
{ "QMP": { "version": json-object, "capabilities": json-array } }
|
|
52 | 52 |
|
53 | 53 |
Where, |
54 | 54 |
|
55 |
- The "version" member contains the Server's version information (the format |
|
56 |
is the same of the 'query-version' command) |
|
55 | 57 |
- The "capabilities" member specify the availability of features beyond the |
56 | 58 |
baseline specification |
57 | 59 |
|
... | ... | |
152 | 154 |
3.1 Server greeting |
153 | 155 |
------------------- |
154 | 156 |
|
155 |
S: {"QMP": {"capabilities": []}} |
|
157 |
S: {"QMP": {"version": {"qemu": "0.12.50", "package": ""}, "capabilities": []}}
|
|
156 | 158 |
|
157 | 159 |
3.2 Simple 'stop' execution |
158 | 160 |
--------------------------- |
b/monitor.c | ||
---|---|---|
4368 | 4368 |
readline_show_prompt(mon->rs); |
4369 | 4369 |
} |
4370 | 4370 |
|
4371 |
static QObject *get_qmp_greeting(void) |
|
4372 |
{ |
|
4373 |
QObject *ver; |
|
4374 |
|
|
4375 |
do_info_version(NULL, &ver); |
|
4376 |
return qobject_from_jsonf("{'QMP':{'version': %p,'capabilities': []}}",ver); |
|
4377 |
} |
|
4378 |
|
|
4371 | 4379 |
/** |
4372 | 4380 |
* monitor_control_event(): Print QMP gretting |
4373 | 4381 |
*/ |
... | ... | |
4379 | 4387 |
|
4380 | 4388 |
json_message_parser_init(&mon->mc->parser, handle_qmp_command); |
4381 | 4389 |
|
4382 |
data = qobject_from_jsonf("{ 'QMP': { 'capabilities': [] } }");
|
|
4390 |
data = get_qmp_greeting();
|
|
4383 | 4391 |
assert(data != NULL); |
4384 | 4392 |
|
4385 | 4393 |
monitor_json_emitter(mon, data); |
Also available in: Unified diff