[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 17/22] qapi: Inline and remove QERR_MISSING_PARAMETER definiti
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 17/22] qapi: Inline and remove QERR_MISSING_PARAMETER definition |
Date: |
Thu, 5 Oct 2023 06:50:34 +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!
*/
Mechanical transformation using sed, manually
removing the definition in include/qapi/qmp/qerror.h.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/qapi/qmp/qerror.h | 3 ---
qapi/opts-visitor.c | 2 +-
qapi/qapi-forward-visitor.c | 2 +-
qapi/qobject-input-visitor.c | 2 +-
4 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
index cc4dae1076..b0f48f22fe 100644
--- a/include/qapi/qmp/qerror.h
+++ b/include/qapi/qmp/qerror.h
@@ -17,9 +17,6 @@
* add new ones!
*/
-#define QERR_MISSING_PARAMETER \
- "Parameter '%s' is missing"
-
#define QERR_PROPERTY_VALUE_BAD \
"Property '%s.%s' doesn't take value '%s'"
diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
index 844db583f4..bf0d8acbd6 100644
--- a/qapi/opts-visitor.c
+++ b/qapi/opts-visitor.c
@@ -218,7 +218,7 @@ lookup_distinct(const OptsVisitor *ov, const char *name,
Error **errp)
list = g_hash_table_lookup(ov->unprocessed_opts, name);
if (!list) {
- error_setg(errp, QERR_MISSING_PARAMETER, name);
+ error_setg(errp, "Parameter '%s' is missing", name);
}
return list;
}
diff --git a/qapi/qapi-forward-visitor.c b/qapi/qapi-forward-visitor.c
index e36d9bc9ba..3fb2c954aa 100644
--- a/qapi/qapi-forward-visitor.c
+++ b/qapi/qapi-forward-visitor.c
@@ -49,7 +49,7 @@ static bool forward_field_translate_name(ForwardFieldVisitor
*v, const char **na
*name = v->to;
return true;
}
- error_setg(errp, QERR_MISSING_PARAMETER, *name);
+ error_setg(errp, "Parameter '%s' is missing", *name);
return false;
}
diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c
index f5fa6c1878..17e9f3b638 100644
--- a/qapi/qobject-input-visitor.c
+++ b/qapi/qobject-input-visitor.c
@@ -168,7 +168,7 @@ static QObject
*qobject_input_get_object(QObjectInputVisitor *qiv,
QObject *obj = qobject_input_try_get_object(qiv, name, consume);
if (!obj) {
- error_setg(errp, QERR_MISSING_PARAMETER, full_name(qiv, name));
+ error_setg(errp, "Parameter '%s' is missing", full_name(qiv, name));
}
return obj;
}
--
2.41.0
- Re: [PATCH v2 10/22] qapi: Correct error message for 'vcpu_dirty_limit' parameter, (continued)
- [PATCH v2 11/22] qapi: Inline QERR_INVALID_PARAMETER_VALUE definition (constant value), Philippe Mathieu-Daudé, 2023/10/05
- [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é <=
- [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
- [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