mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
qmp: constify QmpCommand and list
Since 0b69f6f72c
"qapi: remove
qmp_unregister_command()", the command list can be declared const.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
Message-Id: <20200316171824.2319695-1-marcandre.lureau@redhat.com>
[Rebased]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
df4097aeaf
commit
f0ccc00be1
7 changed files with 16 additions and 15 deletions
|
@ -39,7 +39,8 @@ typedef QTAILQ_HEAD(QmpCommandList, QmpCommand) QmpCommandList;
|
|||
|
||||
void qmp_register_command(QmpCommandList *cmds, const char *name,
|
||||
QmpCommandFunc *fn, QmpCommandOptions options);
|
||||
QmpCommand *qmp_find_command(QmpCommandList *cmds, const char *name);
|
||||
const QmpCommand *qmp_find_command(const QmpCommandList *cmds,
|
||||
const char *name);
|
||||
void qmp_disable_command(QmpCommandList *cmds, const char *name);
|
||||
void qmp_enable_command(QmpCommandList *cmds, const char *name);
|
||||
|
||||
|
@ -47,13 +48,13 @@ bool qmp_command_is_enabled(const QmpCommand *cmd);
|
|||
const char *qmp_command_name(const QmpCommand *cmd);
|
||||
bool qmp_has_success_response(const QmpCommand *cmd);
|
||||
QDict *qmp_error_response(Error *err);
|
||||
QDict *qmp_dispatch(QmpCommandList *cmds, QObject *request,
|
||||
QDict *qmp_dispatch(const QmpCommandList *cmds, QObject *request,
|
||||
bool allow_oob);
|
||||
bool qmp_is_oob(const QDict *dict);
|
||||
|
||||
typedef void (*qmp_cmd_callback_fn)(QmpCommand *cmd, void *opaque);
|
||||
typedef void (*qmp_cmd_callback_fn)(const QmpCommand *cmd, void *opaque);
|
||||
|
||||
void qmp_for_each_command(QmpCommandList *cmds, qmp_cmd_callback_fn fn,
|
||||
void qmp_for_each_command(const QmpCommandList *cmds, qmp_cmd_callback_fn fn,
|
||||
void *opaque);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue