]> git.proxmox.com Git - mirror_qemu.git/commitdiff
qapi-schema: use generated marshaller for 'qmp_capabilities'
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 12 Sep 2016 09:18:57 +0000 (13:18 +0400)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 19 Sep 2016 15:32:21 +0000 (17:32 +0200)
qapi'fy the 'qmp_capabilities' command, makes the command visible in
query-qmp-schema.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20160912091913.15831-3-marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
monitor.c
qapi-schema.json
qmp-commands.hx

index 5c003731e288ba654dd39c44a4d0199a81e36eb6..991eaf7e0c1c4b6a5b4dc7deaf715d9a0afc79df 100644 (file)
--- 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,
index c4f3674d08e49febe2d54e9ce8b0f529012ab7b3..5e15d284689fbef6e17aa656dfb01a22162896c6 100644 (file)
 # 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:
 #
index e6c91936003da81c089a52f8fc4faaf014a0bccd..8a135506dccc9a0e35b2520a390a6c98a5e82635 100644 (file)
@@ -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