On 2/16/21 7:38 AM, marcandre.lur...@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lur...@redhat.com>
> 
> qmp_disable_command() now takes an optional error string to return a
> more explicit error message.
> 
> Fixes:
> https://bugzilla.redhat.com/show_bug.cgi?id=1928806
> 
> Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com>
> ---

> +++ b/qapi/qmp-dispatch.c
> @@ -157,7 +157,7 @@ QDict *qmp_dispatch(const QmpCommandList *cmds, QObject 
> *request,
>      }
>      if (!cmd->enabled) {
>          error_set(&err, ERROR_CLASS_COMMAND_NOT_FOUND,
> -                  "The command %s has been disabled for this instance",
> +                  cmd->err_msg ?: "The command %s has been disabled for this 
> instance",

No trailing dot (good),...

> +++ b/qga/main.c
> @@ -375,7 +375,7 @@ static void ga_disable_non_whitelisted(const QmpCommand 
> *cmd, void *opaque)
>      }
>      if (!whitelisted) {
>          g_debug("disabling command: %s", name);
> -        qmp_disable_command(&ga_commands, name);
> +        qmp_disable_command(&ga_commands, name, "The command was disabled 
> after fsfreeze.");

...while this introduces one (not good).

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


Reply via email to