[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 05/18] monitor: register gen:false commands manua
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH v6 05/18] monitor: register gen:false commands manually |
Date: |
Mon, 12 Sep 2016 13:19:00 +0400 |
Since a few commands are using 'gen': false, they are not registered
automatically by the generator. Register manually instead.
This is in preparation for removal of qapi 'middle' mode generation.
Note that qmp_init_marshal() function isn't run yet, so the commands
aren't actually registered, until module_call_init(MODULE_INIT_QAPI) is
added in a later patch.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
monitor.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/monitor.c b/monitor.c
index e156026..b7ae552 100644
--- a/monitor.c
+++ b/monitor.c
@@ -79,6 +79,7 @@
#include "sysemu/block-backend.h"
#include "sysemu/qtest.h"
#include "qemu/cutils.h"
+#include "qapi/qmp/dispatch.h"
/* for hmp_info_irq/pic */
#if defined(TARGET_SPARC)
@@ -1007,6 +1008,18 @@ static void qmp_query_qmp_schema(QDict *qdict, QObject
**ret_data,
*ret_data = qobject_from_json(qmp_schema_json);
}
+static void qmp_init_marshal(void)
+{
+ qmp_register_command("query-qmp-schema", qmp_query_qmp_schema,
+ QCO_NO_OPTIONS);
+ qmp_register_command("device_add", qmp_device_add,
+ QCO_NO_OPTIONS);
+ qmp_register_command("netdev_add", qmp_netdev_add,
+ QCO_NO_OPTIONS);
+}
+
+qapi_init(qmp_init_marshal);
+
/* set the current CPU defined by the user */
int monitor_set_cpu(int cpu_index)
{
--
2.10.0
- [Qemu-devel] [PATCH v6 00/18] qapi: remove the 'middle' mode, Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 01/18] build-sys: define QEMU_VERSION_{MAJOR, MINOR, MICRO}, Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 02/18] qapi-schema: use generated marshaller for 'qmp_capabilities', Marc-André Lureau, 2016/09/12
- [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 <=
- [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
- [Qemu-devel] [PATCH v6 13/18] qapi: check invalid arguments on no-args commands, Marc-André Lureau, 2016/09/12
- [Qemu-devel] [PATCH v6 14/18] tests: add a test to check invalid args, Marc-André Lureau, 2016/09/12