@@ -220,7 +220,7 @@ def gen_register_command(name, success_response, allow_oob, allow_preconfig):
def gen_registry(registry, prefix):
ret = mcgen('''
-void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds)
+void %(c_prefix)sqmp_register_commands(QmpCommandList *cmds)
{
''',
c_prefix=c_name(prefix, protect=False))
@@ -270,7 +270,7 @@ class QAPISchemaGenCommandVisitor(QAPISchemaModularCVisitor):
def visit_end(self):
(genc, genh) = self._module[self._main_module]
genh.add(mcgen('''
-void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
+void %(c_prefix)sqmp_register_commands(QmpCommandList *cmds);
''',
c_prefix=c_name(self._prefix, protect=False)))
genc.add(gen_registry(self._regy.get_content(), self._prefix))
@@ -1182,7 +1182,7 @@ static void monitor_init_qmp_commands(void)
*/
QTAILQ_INIT(&qmp_commands);
- qmp_init_marshal(&qmp_commands);
+ qmp_register_commands(&qmp_commands);
qmp_register_command(&qmp_commands, "query-qmp-schema",
qmp_query_qmp_schema, QCO_ALLOW_PRECONFIG);
@@ -1487,7 +1487,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);
+ qga_qmp_register_commands(&ga_commands);
init_dfl_pathnames();
config_load(config);
@@ -326,7 +326,7 @@ int main(int argc, char **argv)
g_test_add_func("/qmp/dealloc_partial", test_dealloc_partial);
QTAILQ_INIT(&qmp_commands);
- test_qmp_init_marshal(&qmp_commands);
+ test_qmp_register_commands(&qmp_commands);
g_test_run();
return 0;
@@ -1271,7 +1271,7 @@ Example:
UserDefOne *qmp_my_command(UserDefOneList *arg1, Error **errp);
void qmp_marshal_my_command(QDict *args, QObject **ret, Error **errp);
- void example_qmp_init_marshal(QmpCommandList *cmds);
+ void example_qmp_register_commands(QmpCommandList *cmds);
#endif /* EXAMPLE_QAPI_COMMANDS_H */
$ cat qapi-generated/example-qapi-commands.c
@@ -1332,7 +1332,7 @@ Example:
visit_free(v);
}
- void example_qmp_init_marshal(QmpCommandList *cmds)
+ void example_qmp_register_commands(QmpCommandList *cmds)
{
qmp_register_command(cmds, "my-command",
qmp_marshal_my_command, QCO_NO_OPTIONS);
The function only calls various register_command() now, use a more descriptive name. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> --- scripts/qapi/commands.py | 4 ++-- monitor.c | 2 +- qga/main.c | 2 +- tests/test-qmp-cmds.c | 2 +- docs/devel/qapi-code-gen.txt | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-)