[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/13] qapi-commands: don't initialize command list
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH 02/13] qapi-commands: don't initialize command list in qmp_init_marshall() |
Date: |
Sun, 16 Dec 2018 18:08:51 +0400 |
This will let the caller add several list of commands coming from
different schemas (the following patches split the schemas for common
and arch-specific parts).
Signed-off-by: Marc-André Lureau <address@hidden>
---
scripts/qapi/commands.py | 2 --
monitor.c | 1 +
qga/main.c | 1 +
tests/test-qmp-cmds.c | 1 +
docs/devel/qapi-code-gen.txt | 2 --
5 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py
index 0f3c991918..a9b2ecb304 100644
--- a/scripts/qapi/commands.py
+++ b/scripts/qapi/commands.py
@@ -222,8 +222,6 @@ def gen_registry(registry, prefix):
void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds)
{
- QTAILQ_INIT(cmds);
-
''',
c_prefix=c_name(prefix, protect=False))
ret += registry
diff --git a/monitor.c b/monitor.c
index 7848a3cb0d..30e8926002 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1181,6 +1181,7 @@ static void monitor_init_qmp_commands(void)
* "qmp_capabilities", to enforce capability negotiation
*/
+ QTAILQ_INIT(&qmp_commands);
qmp_init_marshal(&qmp_commands);
qmp_register_command(&qmp_commands, "query-qmp-schema",
diff --git a/qga/main.c b/qga/main.c
index 87a0711c14..1d6c1024c9 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -1486,6 +1486,7 @@ int main(int argc, char **argv)
config->log_level = G_LOG_LEVEL_ERROR | G_LOG_LEVEL_CRITICAL;
+ QTAILQ_INIT(&ga_commands);
qga_qmp_init_marshal(&ga_commands);
init_dfl_pathnames();
diff --git a/tests/test-qmp-cmds.c b/tests/test-qmp-cmds.c
index 481cb069ca..bbd52cfb69 100644
--- a/tests/test-qmp-cmds.c
+++ b/tests/test-qmp-cmds.c
@@ -325,6 +325,7 @@ int main(int argc, char **argv)
g_test_add_func("/qmp/dealloc_types", test_dealloc_types);
g_test_add_func("/qmp/dealloc_partial", test_dealloc_partial);
+ QTAILQ_INIT(&qmp_commands);
test_qmp_init_marshal(&qmp_commands);
g_test_run();
diff --git a/docs/devel/qapi-code-gen.txt b/docs/devel/qapi-code-gen.txt
index 43bd853e69..681177dec1 100644
--- a/docs/devel/qapi-code-gen.txt
+++ b/docs/devel/qapi-code-gen.txt
@@ -1334,8 +1334,6 @@ Example:
void example_qmp_init_marshal(QmpCommandList *cmds)
{
- QTAILQ_INIT(cmds);
-
qmp_register_command(cmds, "my-command",
qmp_marshal_my_command, QCO_NO_OPTIONS);
}
--
2.20.0
- [Qemu-devel] [PATCH 00/13] qapi: add #if pre-processor conditions to generated code (part 3), Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 01/13] build-sys: move qmp-introspect per target, Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 02/13] qapi-commands: don't initialize command list in qmp_init_marshall(),
Marc-André Lureau <=
- [Qemu-devel] [PATCH 03/13] qapi-commands: rename init_marshal() to register_commands(), Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 04/13] RFC: qapi: learn to split the schema by 'top-unit', Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 05/13] qapi: add a top-unit 'target' schema, Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 06/13] qapi: make rtc-reset-reinjection and SEV depend on TARGET_I386, Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 07/13] qapi: make s390 commands depend on TARGET_S390X, Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 08/13] target.json: add a note about query-cpu* not being s390x-specific, Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 09/13] qapi: make query-gic-capabilities depend on TARGET_ARM, Marc-André Lureau, 2018/12/16
- [Qemu-devel] [PATCH 10/13] qapi: make query-cpu-model-expansion depend on s390 or x86, Marc-André Lureau, 2018/12/16