[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/21] qapi: Inline and remove QERR_INVALID_PARAMETER_TYPE defini
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 09/21] qapi: Inline and remove QERR_INVALID_PARAMETER_TYPE definition |
Date: |
Wed, 4 Oct 2023 19:31:44 +0200 |
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 changes (escaping the format in qapi/visit.py).
Remove the definition in include/qapi/qmp/qerror.h.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/qapi/qmp/qerror.h | 3 ---
qom/object.c | 3 ++-
scripts/qapi/visit.py | 4 ++--
3 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
index 63ab775dc5..b723830eff 100644
--- a/include/qapi/qmp/qerror.h
+++ b/include/qapi/qmp/qerror.h
@@ -17,9 +17,6 @@
* add new ones!
*/
-#define QERR_INVALID_PARAMETER_TYPE \
- "Invalid parameter type for '%s', expected: %s"
-
#define QERR_INVALID_PARAMETER_VALUE \
"Parameter '%s' expects %s"
diff --git a/qom/object.c b/qom/object.c
index 890fa0a106..eea61a5068 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1855,7 +1855,8 @@ static Object *object_resolve_link(Object *obj, const
char *name,
} else if (!target) {
target = object_resolve_path(path, &ambiguous);
if (target || ambiguous) {
- error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name, target_type);
+ error_setg(errp, "Invalid parameter type for '%s', expected: %s",
+ name, target_type);
} else {
error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,
"Device '%s' not found", path);
diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py
index c56ea4d724..4b4a442383 100644
--- a/scripts/qapi/visit.py
+++ b/scripts/qapi/visit.py
@@ -278,8 +278,8 @@ def gen_visit_alternate(name: str, variants:
QAPISchemaVariants) -> str:
abort();
default:
assert(visit_is_input(v));
- error_setg(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",
- "%(name)s");
+ error_setg(errp, "Invalid parameter type for '%%s', expected:
%(name)s",
+ name ? name : "null");
/* Avoid passing invalid *obj to qapi_free_%(c_name)s() */
g_free(*obj);
*obj = NULL;
--
2.41.0
- [PATCH 03/21] qapi: Inline and remove QERR_DEVICE_IN_USE definition, (continued)
- [PATCH 03/21] qapi: Inline and remove QERR_DEVICE_IN_USE definition, Philippe Mathieu-Daudé, 2023/10/04
- [PATCH 04/21] qapi: Inline and remove QERR_DEVICE_NO_HOTPLUG definition, Philippe Mathieu-Daudé, 2023/10/04
- [PATCH 06/21] qapi: Inline and remove QERR_INVALID_PARAMETER definition, Philippe Mathieu-Daudé, 2023/10/04
- [PATCH 05/21] qapi: Inline QERR_INVALID_PARAMETER definition (constant parameter), Philippe Mathieu-Daudé, 2023/10/04
- [PATCH 07/21] qapi: Inline QERR_INVALID_PARAMETER_TYPE definition (constant param), Philippe Mathieu-Daudé, 2023/10/04
- [PATCH 08/21] qapi: Inline QERR_INVALID_PARAMETER_TYPE definition (constant value), Philippe Mathieu-Daudé, 2023/10/04
- [PATCH 10/21] qapi: Inline QERR_INVALID_PARAMETER_VALUE definition (constant value), Philippe Mathieu-Daudé, 2023/10/04
- [PATCH 09/21] qapi: Inline and remove QERR_INVALID_PARAMETER_TYPE definition,
Philippe Mathieu-Daudé <=
- [PATCH 11/21] qapi: Inline QERR_INVALID_PARAMETER_VALUE definition (constant param), Philippe Mathieu-Daudé, 2023/10/04
- [PATCH 13/21] qapi: Inline and remove QERR_IO_ERROR definition, Philippe Mathieu-Daudé, 2023/10/04
- [PATCH 12/21] qapi: Inline and remove QERR_INVALID_PARAMETER_VALUE definition, Philippe Mathieu-Daudé, 2023/10/04
- [PATCH 14/21] qapi: Inline and remove QERR_MIGRATION_ACTIVE definition, Philippe Mathieu-Daudé, 2023/10/04
- [PATCH 15/21] qapi: Inline QERR_MISSING_PARAMETER definition (constant parameter), Philippe Mathieu-Daudé, 2023/10/04
- [PATCH 16/21] qapi: Inline and remove QERR_MISSING_PARAMETER definition, Philippe Mathieu-Daudé, 2023/10/04