[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 18/22] qapi: Inline and remove QERR_PROPERTY_VALUE_BAD def
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v2 18/22] qapi: Inline and remove QERR_PROPERTY_VALUE_BAD definition |
Date: |
Fri, 20 Oct 2023 15:00:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Philippe Mathieu-Daudé <philmd@linaro.org> writes:
> Address the comment added in commit 4629ed1e98
> ("qerror: Finally unused, clean up"), from 2015:
>
> /*
> * These macros will go away, please don't use
> * in new code, and do not add new ones!
> */
>
> Manual change. Remove the definition in
> include/qapi/qmp/qerror.h.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> include/qapi/qmp/qerror.h | 3 ---
> hw/core/qdev-properties.c | 2 +-
> target/i386/cpu.c | 2 +-
> 3 files changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
> index b0f48f22fe..7862ac55a1 100644
> --- a/include/qapi/qmp/qerror.h
> +++ b/include/qapi/qmp/qerror.h
> @@ -17,9 +17,6 @@
> * add new ones!
> */
>
> -#define QERR_PROPERTY_VALUE_BAD \
> - "Property '%s.%s' doesn't take value '%s'"
> -
> #define QERR_PROPERTY_VALUE_OUT_OF_RANGE \
> "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ",
> maximum: %" PRId64 ")"
>
> diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
> index 357b8761b5..44fc1686e0 100644
> --- a/hw/core/qdev-properties.c
> +++ b/hw/core/qdev-properties.c
> @@ -682,7 +682,7 @@ void error_set_from_qdev_prop_error(Error **errp, int
> ret, Object *obj,
> break;
> default:
> case -EINVAL:
> - error_setg(errp, QERR_PROPERTY_VALUE_BAD,
> + error_setg(errp, "Property '%s.%s' doesn't take value '%s'",
> object_get_typename(obj), name, value);
> break;
> case -ENOENT:
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index ed72883bf3..e5a14885ed 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -5190,7 +5190,7 @@ static void x86_cpuid_set_vendor(Object *obj, const
> char *value,
> int i;
>
> if (strlen(value) != CPUID_VENDOR_SZ) {
> - error_setg(errp, QERR_PROPERTY_VALUE_BAD, "", "vendor", value);
Reporting the actual problem would be better: we need the value to be
exactly CPUID_VENDOR_SZ characters long.
> + error_setg(errp, "Property 'vendor' doesn't take value '%s'", value);
> return;
> }
- Re: [PATCH v2 11/22] qapi: Inline QERR_INVALID_PARAMETER_VALUE definition (constant value), (continued)
- [PATCH v2 12/22] qapi: Inline QERR_INVALID_PARAMETER_VALUE definition (constant param), Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 13/22] qapi: Inline and remove QERR_INVALID_PARAMETER_VALUE definition, Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 14/22] qapi: Inline and remove QERR_IO_ERROR definition, Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 15/22] qapi: Inline and remove QERR_MIGRATION_ACTIVE definition, Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 17/22] qapi: Inline and remove QERR_MISSING_PARAMETER definition, Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 19/22] qapi: Inline and remove QERR_PROPERTY_VALUE_OUT_OF_RANGE definition, Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 18/22] qapi: Inline and remove QERR_PROPERTY_VALUE_BAD definition, Philippe Mathieu-Daudé, 2023/10/05
- Re: [PATCH v2 18/22] qapi: Inline and remove QERR_PROPERTY_VALUE_BAD definition,
Markus Armbruster <=
- [RFC PATCH v2 21/22] qapi: Inline and remove QERR_UNSUPPORTED definition, Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 16/22] qapi: Inline QERR_MISSING_PARAMETER definition (constant parameter), Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 20/22] qapi: Inline and remove QERR_QGA_COMMAND_FAILED definition, Philippe Mathieu-Daudé, 2023/10/05
- [PATCH v2 22/22] qapi: Remove 'qapi/qmp/qerror.h' header, Philippe Mathieu-Daudé, 2023/10/05
- Re: [PATCH v2 00/22] qapi: Kill 'qapi/qmp/qerror.h' for good, Markus Armbruster, 2023/10/05