[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/11] QMP: advertise asynchronous messages
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 05/11] QMP: advertise asynchronous messages |
Date: |
Thu, 21 Jan 2010 19:09:34 -0200 |
With feature negotiation support asynchronous messages are
going to behave like any protocol capability, that is, it
is disabled by default, it can be negotiated and has to be
advertised.
TODO: update spec.
Signed-off-by: Luiz Capitulino <address@hidden>
---
monitor.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/monitor.c b/monitor.c
index fc6a1ed..70a59c7 100644
--- a/monitor.c
+++ b/monitor.c
@@ -4251,6 +4251,21 @@ void monitor_resume(Monitor *mon)
readline_show_prompt(mon->rs);
}
+/* XXX: Do we need anything fancier here? */
+static QObject *qmp_capabilities(void)
+{
+ int i;
+ QList *qmp_caps;
+ const char *capabilities[] = { "async messages", NULL };
+
+ qmp_caps = qlist_new();
+ for (i = 0; capabilities[i]; i++) {
+ qlist_append(qmp_caps, qstring_from_str(capabilities[i]));
+ }
+
+ return QOBJECT(qmp_caps);
+}
+
/**
* monitor_control_event(): Print QMP gretting
*/
@@ -4262,7 +4277,8 @@ 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 = qobject_from_jsonf("{ 'QMP': { 'capabilities': %p } }",
+ qmp_capabilities());
assert(data != NULL);
monitor_json_emitter(mon, data);
--
1.6.6
- [Qemu-devel] [RFC 00/11]: QMP feature negotiation support, Luiz Capitulino, 2010/01/21
- [Qemu-devel] [PATCH 01/11] QMP: Initial mode-oriented bits, Luiz Capitulino, 2010/01/21
- [Qemu-devel] [PATCH 02/11] QMP: Introduce 'query-qmp-mode' command, Luiz Capitulino, 2010/01/21
- [Qemu-devel] [PATCH 03/11] QError: Add QMP mode-oriented errors, Luiz Capitulino, 2010/01/21
- [Qemu-devel] [PATCH 04/11] QMP: Introduce qmp_switch_mode command, Luiz Capitulino, 2010/01/21
- [Qemu-devel] [PATCH 05/11] QMP: advertise asynchronous messages,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 06/11] QMP: Array-based async messages, Luiz Capitulino, 2010/01/21
- [Qemu-devel] [PATCH 07/11] QError: New QERR_ASYNC_MSG_NOT_FOUND, Luiz Capitulino, 2010/01/21
- [Qemu-devel] [PATCH 08/11] QMP: Asynchronous messages enable/disable support, Luiz Capitulino, 2010/01/21
- Re: [Qemu-devel] [PATCH 08/11] QMP: Asynchronous messages enable/disable support, Anthony Liguori, 2010/01/22
- Re: [Qemu-devel] [PATCH 08/11] QMP: Asynchronous messages enable/disable support, Luiz Capitulino, 2010/01/22
- Re: [Qemu-devel] [PATCH 08/11] QMP: Asynchronous messages enable/disable support, Anthony Liguori, 2010/01/22
- Re: [Qemu-devel] [PATCH 08/11] QMP: Asynchronous messages enable/disable support, Markus Armbruster, 2010/01/25
- Re: [Qemu-devel] [PATCH 08/11] QMP: Asynchronous messages enable/disable support, Avi Kivity, 2010/01/25
- Re: [Qemu-devel] [PATCH 08/11] QMP: Asynchronous messages enable/disable support, Luiz Capitulino, 2010/01/25
- Re: [Qemu-devel] [PATCH 08/11] QMP: Asynchronous messages enable/disable support, Avi Kivity, 2010/01/24