@@ -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
@@ -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",
@@ -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();
@@ -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();
@@ -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);
}
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 <marcandre.lureau@redhat.com> --- 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(-)