diff mbox series

[2/5] hw/core: Remove use of QERR_FEATURE_DISABLED

Message ID 20211029230147.2465055-3-philmd@redhat.com
State New
Headers show
Series hw/core: Remove uses of obsolete QERR_ definitions | expand

Commit Message

Philippe Mathieu-Daudé Oct. 29, 2021, 11:01 p.m. UTC
QERR_FEATURE_DISABLED definition is obsolete since 2015 (commit
4629ed1e989, "qerror: Finally unused, clean up"). Replace it.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/core/machine-qmp-cmds.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Markus Armbruster Nov. 19, 2021, 8:18 a.m. UTC | #1
Philippe Mathieu-Daudé <philmd@redhat.com> writes:

> QERR_FEATURE_DISABLED definition is obsolete since 2015 (commit
> 4629ed1e989, "qerror: Finally unused, clean up"). Replace it.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/core/machine-qmp-cmds.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
> index 216fdfaf3a0..f2eff433bf0 100644
> --- a/hw/core/machine-qmp-cmds.c
> +++ b/hw/core/machine-qmp-cmds.c
> @@ -138,7 +138,8 @@ HotpluggableCPUList *qmp_query_hotpluggable_cpus(Error **errp)
>      MachineClass *mc = MACHINE_GET_CLASS(ms);
>  
>      if (!mc->has_hotpluggable_cpus) {
> -        error_setg(errp, QERR_FEATURE_DISABLED, "query-hotpluggable-cpus");
> +        error_setg(errp,
> +                   "The feature 'query-hotpluggable-cpus' is not enabled");
>          return NULL;
>      }

Again, the error message could use improvement, say "machine does not
support hot-plugging CPUs".

I can't help to wonder why this is an error, though.  What's the
difference to successfully returning an empty list?  David, you added
the command, can you explain?

By the way:

    ##
    # @query-hotpluggable-cpus:
    #
    # TODO: Better documentation; currently there is none.

The TODO is three years old, and the command four.  Can we resolve it,
please?
diff mbox series

Patch

diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c
index 216fdfaf3a0..f2eff433bf0 100644
--- a/hw/core/machine-qmp-cmds.c
+++ b/hw/core/machine-qmp-cmds.c
@@ -138,7 +138,8 @@  HotpluggableCPUList *qmp_query_hotpluggable_cpus(Error **errp)
     MachineClass *mc = MACHINE_GET_CLASS(ms);
 
     if (!mc->has_hotpluggable_cpus) {
-        error_setg(errp, QERR_FEATURE_DISABLED, "query-hotpluggable-cpus");
+        error_setg(errp,
+                   "The feature 'query-hotpluggable-cpus' is not enabled");
         return NULL;
     }