qapi: Move and rename qapi/qmp/dispatch.h to qapi/qmp-registry.h

The general expectation is that header files should follow the same
file/path naming scheme as the corresponding source file. There are
various historical exceptions to this practice in QEMU, with one of
the most notable being the include/qapi/qmp/ directory.

include/qapi/qmp/dispatch.h corresponds mostly to qapi/qmp-registry.c.
Move and rename it to include/qapi/qmp-registry.h.

Now just qerror.h is left in include/qapi/qmp/.  Since it's deprecated
& (slowly) getting eliminated anyway, it isn't worth moving.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-ID: <20241118151235.2665921-3-armbru@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2024-11-18 16:12:35 +01:00 committed by Markus Armbruster
parent 407bc4bf90
commit 153b0989d8
10 changed files with 9 additions and 9 deletions

View file

@ -1855,7 +1855,7 @@ Example::
#ifndef EXAMPLE_QAPI_INIT_COMMANDS_H #ifndef EXAMPLE_QAPI_INIT_COMMANDS_H
#define EXAMPLE_QAPI_INIT_COMMANDS_H #define EXAMPLE_QAPI_INIT_COMMANDS_H
#include "qapi/qmp/dispatch.h" #include "qapi/qmp-registry.h"
void example_qmp_init_marshal(QmpCommandList *cmds); void example_qmp_init_marshal(QmpCommandList *cmds);

View file

@ -28,7 +28,7 @@
#include "chardev/char-fe.h" #include "chardev/char-fe.h"
#include "monitor/monitor.h" #include "monitor/monitor.h"
#include "qapi/qapi-types-control.h" #include "qapi/qapi-types-control.h"
#include "qapi/qmp/dispatch.h" #include "qapi/qmp-registry.h"
#include "qobject/json-parser.h" #include "qobject/json-parser.h"
#include "qemu/readline.h" #include "qemu/readline.h"
#include "system/iothread.h" #include "system/iothread.h"

View file

@ -16,7 +16,7 @@
#include "block/aio.h" #include "block/aio.h"
#include "qapi/compat-policy.h" #include "qapi/compat-policy.h"
#include "qapi/error.h" #include "qapi/error.h"
#include "qapi/qmp/dispatch.h" #include "qapi/qmp-registry.h"
#include "qobject/qdict.h" #include "qobject/qdict.h"
#include "qobject/qjson.h" #include "qobject/qjson.h"
#include "qapi/qobject-input-visitor.h" #include "qapi/qobject-input-visitor.h"

View file

@ -13,7 +13,7 @@
*/ */
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/qmp/dispatch.h" #include "qapi/qmp-registry.h"
void qmp_register_command(QmpCommandList *cmds, const char *name, void qmp_register_command(QmpCommandList *cmds, const char *name,
QmpCommandFunc *fn, QmpCommandOptions options, QmpCommandFunc *fn, QmpCommandOptions options,

View file

@ -13,7 +13,7 @@
#ifndef GUEST_AGENT_CORE_H #ifndef GUEST_AGENT_CORE_H
#define GUEST_AGENT_CORE_H #define GUEST_AGENT_CORE_H
#include "qapi/qmp/dispatch.h" #include "qapi/qmp-registry.h"
#include "qga-qapi-types.h" #include "qga-qapi-types.h"
#define QGA_READ_COUNT_DEFAULT 4096 #define QGA_READ_COUNT_DEFAULT 4096

View file

@ -346,7 +346,7 @@ class QAPISchemaGenCommandVisitor(QAPISchemaModularCVisitor):
def visit_begin(self, schema: QAPISchema) -> None: def visit_begin(self, schema: QAPISchema) -> None:
self._add_module('./init', ' * QAPI Commands initialization') self._add_module('./init', ' * QAPI Commands initialization')
self._genh.add(mcgen(''' self._genh.add(mcgen('''
#include "qapi/qmp/dispatch.h" #include "qapi/qmp-registry.h"
void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds); void %(c_prefix)sqmp_init_marshal(QmpCommandList *cmds);
''', ''',

View file

@ -1,5 +1,5 @@
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/qmp/dispatch.h" #include "qapi/qmp-registry.h"
bool qmp_command_available(const QmpCommand *cmd, Error **errp) bool qmp_command_available(const QmpCommand *cmd, Error **errp)
{ {

View file

@ -1,6 +1,6 @@
#include "qemu/osdep.h" #include "qemu/osdep.h"
#include "qapi/qapi-commands-control.h" #include "qapi/qapi-commands-control.h"
#include "qapi/qmp/dispatch.h" #include "qapi/qmp-registry.h"
void qmp_quit(Error **errp) void qmp_quit(Error **errp)
{ {

View file

@ -26,7 +26,7 @@
#include "system/runstate.h" #include "system/runstate.h"
#include "qapi/error.h" #include "qapi/error.h"
#include "qapi/qapi-commands-qdev.h" #include "qapi/qapi-commands-qdev.h"
#include "qapi/qmp/dispatch.h" #include "qapi/qmp-registry.h"
#include "qobject/qdict.h" #include "qobject/qdict.h"
#include "qapi/qmp/qerror.h" #include "qapi/qmp/qerror.h"
#include "qobject/qstring.h" #include "qobject/qstring.h"