[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 05/17] monitor: register gen:false commands manua
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v4 05/17] monitor: register gen:false commands manually |
Date: |
Wed, 10 Aug 2016 22:02:23 +0400 |
From: Marc-André Lureau <address@hidden>
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 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.9.0
- [Qemu-devel] [PATCH v4 00/17] qapi: remove the 'middle' mode, marcandre . lureau, 2016/08/10
- [Qemu-devel] [PATCH v4 01/17] build-sys: define QEMU_VERSION_{MAJOR, MINOR, MICRO}, marcandre . lureau, 2016/08/10
- [Qemu-devel] [PATCH v4 02/17] qapi-schema: use generated marshaller for 'qmp_capabilities', marcandre . lureau, 2016/08/10
- [Qemu-devel] [PATCH v4 03/17] qapi-schema: add 'device_add', marcandre . lureau, 2016/08/10
- [Qemu-devel] [PATCH v4 04/17] monitor: simplify invalid_qmp_mode(), marcandre . lureau, 2016/08/10
- [Qemu-devel] [PATCH v4 05/17] monitor: register gen:false commands manually,
marcandre . lureau <=
- [Qemu-devel] [PATCH v4 06/17] monitor: unregister conditional commands, marcandre . lureau, 2016/08/10
- Re: [Qemu-devel] [PATCH v4 06/17] monitor: unregister conditional commands, Markus Armbruster, 2016/08/17
- [Qemu-devel] [PATCH v4 07/17] qapi: export the marshallers, marcandre . lureau, 2016/08/10
- [Qemu-devel] [PATCH v4 08/17] monitor: use qmp_find_command() (using generated qapi code), marcandre . lureau, 2016/08/10
- [Qemu-devel] [PATCH v4 09/17] monitor: implement 'qmp_query_commands' without qmp_cmds, marcandre . lureau, 2016/08/10