[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 02/18] qapi-schema: use generated marshaller for
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v6 02/18] qapi-schema: use generated marshaller for 'qmp_capabilities' |
Date: |
Mon, 12 Sep 2016 13:18:57 +0400 |
qapi'fy the 'qmp_capabilities' command, makes the command visible in
query-qmp-schema.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
---
monitor.c | 4 ++--
qapi-schema.json | 21 +++++++++++++++++++++
qmp-commands.hx | 2 +-
3 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/monitor.c b/monitor.c
index 5c00373..991eaf7 100644
--- a/monitor.c
+++ b/monitor.c
@@ -617,7 +617,7 @@ static void monitor_qapi_event_init(void)
qmp_event_set_func_emit(monitor_qapi_event_queue);
}
-static void qmp_capabilities(QDict *params, QObject **ret_data, Error **errp)
+void qmp_qmp_capabilities(Error **errp)
{
cur_mon->qmp.in_command_mode = true;
}
@@ -3656,7 +3656,7 @@ static int monitor_can_read(void *opaque)
static bool invalid_qmp_mode(const Monitor *mon, const mon_cmd_t *cmd,
Error **errp)
{
- bool is_cap = cmd->mhandler.cmd_new == qmp_capabilities;
+ bool is_cap = cmd->mhandler.cmd_new == qmp_marshal_qmp_capabilities;
if (is_cap && mon->qmp.in_command_mode) {
error_set(errp, ERROR_CLASS_COMMAND_NOT_FOUND,
diff --git a/qapi-schema.json b/qapi-schema.json
index c4f3674..5e15d28 100644
--- a/qapi-schema.json
+++ b/qapi-schema.json
@@ -20,6 +20,27 @@
# QAPI introspection
{ 'include': 'qapi/introspect.json' }
+##
+# @qmp_capabilities:
+#
+# Enable QMP capabilities.
+#
+# Arguments: None.
+#
+# Example:
+#
+# -> { "execute": "qmp_capabilities" }
+# <- { "return": {} }
+#
+# Notes: This command is valid exactly when first connecting: it must be
+# issued before any other command will be accepted, and will fail once the
+# monitor is accepting other commands. (see qemu docs/qmp-spec.txt)
+#
+# Since: 0.13
+#
+##
+{ 'command': 'qmp_capabilities' }
+
##
# @LostTickPolicy:
#
diff --git a/qmp-commands.hx b/qmp-commands.hx
index e6c9193..8a13550 100644
--- a/qmp-commands.hx
+++ b/qmp-commands.hx
@@ -2219,7 +2219,7 @@ EQMP
.args_type = "",
.params = "",
.help = "enable QMP capabilities",
- .mhandler.cmd_new = qmp_capabilities,
+ .mhandler.cmd_new = qmp_marshal_qmp_capabilities,
},
SQMP
--
2.10.0
- [Qemu-devel] [PATCH v6 00/18] qapi: remove the 'middle' mode, Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 02/18] qapi-schema: use generated marshaller for 'qmp_capabilities',
Marc-André Lureau <=
- [Qemu-devel] [PATCH v6 03/18] qapi-schema: add 'device_add', Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 04/18] monitor: simplify invalid_qmp_mode(), Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 05/18] monitor: register gen:false commands manually, Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 06/18] qapi: Support unregistering QMP commands, Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 07/18] qmp: Hack to keep commands configuration-specific, Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 08/18] qapi: export the marshallers, Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 10/18] monitor: implement 'qmp_query_commands' without qmp_cmds, Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 09/18] monitor: use qmp_find_command() (using generated qapi code), Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 12/18] qapi: remove the "middle" mode, Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 11/18] monitor: remove mhandler.cmd_new, Marc-André Lureau, 2016/09/12