mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -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
|
@ -359,7 +359,7 @@ static gint ga_strcmp(gconstpointer str1, gconstpointer str2)
|
|||
}
|
||||
|
||||
/* disable commands that aren't safe for fsfreeze */
|
||||
static void ga_disable_non_whitelisted(QmpCommand *cmd, void *opaque)
|
||||
static void ga_disable_non_whitelisted(const QmpCommand *cmd, void *opaque)
|
||||
{
|
||||
bool whitelisted = false;
|
||||
int i = 0;
|
||||
|
@ -378,7 +378,7 @@ static void ga_disable_non_whitelisted(QmpCommand *cmd, void *opaque)
|
|||
}
|
||||
|
||||
/* [re-]enable all commands, except those explicitly blacklisted by user */
|
||||
static void ga_enable_non_blacklisted(QmpCommand *cmd, void *opaque)
|
||||
static void ga_enable_non_blacklisted(const QmpCommand *cmd, void *opaque)
|
||||
{
|
||||
GList *blacklist = opaque;
|
||||
const char *name = qmp_command_name(cmd);
|
||||
|
@ -918,7 +918,7 @@ int64_t ga_get_fd_handle(GAState *s, Error **errp)
|
|||
return handle;
|
||||
}
|
||||
|
||||
static void ga_print_cmd(QmpCommand *cmd, void *opaque)
|
||||
static void ga_print_cmd(const QmpCommand *cmd, void *opaque)
|
||||
{
|
||||
printf("%s\n", qmp_command_name(cmd));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue