[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 17/18] monitor: Move qmp_query_qmp_schema to qmp-cmds-monitor
From: |
Kevin Wolf |
Subject: |
[RFC PATCH 17/18] monitor: Move qmp_query_qmp_schema to qmp-cmds-monitor.c |
Date: |
Thu, 17 Oct 2019 15:02:03 +0200 |
monitor/misc.c contains code that works only in the system emulator, so
it can't be linked to the storage daemon. In order to make schema
introspection available for the storage daemon, move the function to
monitor/qmp-cmds-monitor.c, which can be linked into the storage daemon.
Signed-off-by: Kevin Wolf <address@hidden>
---
monitor/monitor-internal.h | 3 +++
monitor/misc.c | 16 ----------------
monitor/qmp-cmds-monitor.c | 16 ++++++++++++++++
3 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/monitor/monitor-internal.h b/monitor/monitor-internal.h
index 451aa64c1a..b91cb09ee5 100644
--- a/monitor/monitor-internal.h
+++ b/monitor/monitor-internal.h
@@ -180,4 +180,7 @@ void help_cmd(Monitor *mon, const char *name);
void handle_hmp_command(MonitorHMP *mon, const char *cmdline);
int hmp_compare_cmd(const char *name, const char *list);
+void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,
+ Error **errp);
+
#endif
diff --git a/monitor/misc.c b/monitor/misc.c
index 95c87df09b..4c90c6813e 100644
--- a/monitor/misc.c
+++ b/monitor/misc.c
@@ -69,7 +69,6 @@
#include "qapi/qapi-commands.h"
#include "qapi/error.h"
#include "qapi/qmp-event.h"
-#include "qapi/qapi-introspect.h"
#include "sysemu/cpus.h"
#include "qemu/cutils.h"
#include "tcg/tcg.h"
@@ -229,21 +228,6 @@ static void hmp_info_help(Monitor *mon, const QDict *qdict)
help_cmd(mon, "info");
}
-/*
- * Minor hack: generated marshalling suppressed for this command
- * ('gen': false in the schema) so we can parse the JSON string
- * directly into QObject instead of first parsing it with
- * visit_type_SchemaInfoList() into a SchemaInfoList, then marshal it
- * to QObject with generated output marshallers, every time. Instead,
- * we do it in test-qobject-input-visitor.c, just to make sure
- * qapi-gen.py's output actually conforms to the schema.
- */
-static void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,
- Error **errp)
-{
- *ret_data = qobject_from_qlit(&qmp_schema_qlit);
-}
-
static void monitor_init_qmp_commands(void)
{
/*
diff --git a/monitor/qmp-cmds-monitor.c b/monitor/qmp-cmds-monitor.c
index acebfd3716..7215392f3e 100644
--- a/monitor/qmp-cmds-monitor.c
+++ b/monitor/qmp-cmds-monitor.c
@@ -29,6 +29,7 @@
#include "qapi/error.h"
#include "qapi/qapi-commands-monitor.h"
#include "qapi/qapi-emit-events.h"
+#include "qapi/qapi-introspect.h"
/*
* Accept QMP capabilities in @list for @mon.
@@ -151,3 +152,18 @@ EventInfoList *qmp_query_events(Error **errp)
return ev_list;
}
+
+/*
+ * Minor hack: generated marshalling suppressed for this command
+ * ('gen': false in the schema) so we can parse the JSON string
+ * directly into QObject instead of first parsing it with
+ * visit_type_SchemaInfoList() into a SchemaInfoList, then marshal it
+ * to QObject with generated output marshallers, every time. Instead,
+ * we do it in test-qobject-input-visitor.c, just to make sure
+ * qapi-gen.py's output actually conforms to the schema.
+ */
+void qmp_query_qmp_schema(QDict *qdict, QObject **ret_data,
+ Error **errp)
+{
+ *ret_data = qobject_from_qlit(&qmp_schema_qlit);
+}
--
2.20.1
- [RFC PATCH 07/18] blockdev-nbd: Boxed argument type for nbd-server-add, (continued)
- [RFC PATCH 07/18] blockdev-nbd: Boxed argument type for nbd-server-add, Kevin Wolf, 2019/10/17
- [RFC PATCH 10/18] qemu-storage-daemon: Add --chardev option, Kevin Wolf, 2019/10/17
- [RFC PATCH 08/18] qemu-storage-daemon: Add --export option, Kevin Wolf, 2019/10/17
- [RFC PATCH 11/18] monitor: Move monitor option parsing to monitor/monitor.c, Kevin Wolf, 2019/10/17
- [RFC PATCH 09/18] qemu-storage-daemon: Add main loop, Kevin Wolf, 2019/10/17
- [RFC PATCH 12/18] stubs: Update monitor stubs for qemu-storage-daemon, Kevin Wolf, 2019/10/17
- [RFC PATCH 15/18] qapi: Support empty modules, Kevin Wolf, 2019/10/17
- [RFC PATCH 14/18] monitor: Create monitor/qmp-cmds-monitor.c, Kevin Wolf, 2019/10/17
- [RFC PATCH 13/18] qapi: Create module 'monitor', Kevin Wolf, 2019/10/17
- [RFC PATCH 16/18] qapi: Create 'pragma' module, Kevin Wolf, 2019/10/17
- [RFC PATCH 17/18] monitor: Move qmp_query_qmp_schema to qmp-cmds-monitor.c,
Kevin Wolf <=
- [RFC PATCH 18/18] qemu-storage-daemon: Add --monitor option, Kevin Wolf, 2019/10/17
- Re: [RFC PATCH 00/18] Add qemu-storage-daemon, Kevin Wolf, 2019/10/24
- Re: [RFC PATCH 00/18] Add qemu-storage-daemon, Vladimir Sementsov-Ogievskiy, 2019/10/24