aboutsummaryrefslogtreecommitdiff
path: root/qapi/qapi-visit-core.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-03-17 11:54:50 +0100
committerMarkus Armbruster <armbru@redhat.com>2015-06-22 18:20:40 +0200
commitc6bd8c706a799eb0fece99f468aaa22b818036f3 (patch)
treef6f5c9119c642fee35cdd98957c3bfd30527a76d /qapi/qapi-visit-core.c
parent75158ebbe259f0bd8bf435e8f4827a43ec89c877 (diff)
qerror: Clean up QERR_ macros to expand into a single string
These macros expand into error class enumeration constant, comma, string. Unclean. Has been that way since commit 13f59ae. The error class is always ERROR_CLASS_GENERIC_ERROR since the previous commit. Clean up as follows: * Prepend every use of a QERR_ macro by ERROR_CLASS_GENERIC_ERROR, and delete it from the QERR_ macro. No change after preprocessing. * Rewrite error_set(ERROR_CLASS_GENERIC_ERROR, ...) into error_setg(...). Again, no change after preprocessing. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'qapi/qapi-visit-core.c')
-rw-r--r--qapi/qapi-visit-core.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c
index a18ba1670f..5a7c900504 100644
--- a/qapi/qapi-visit-core.c
+++ b/qapi/qapi-visit-core.c
@@ -110,8 +110,8 @@ void visit_type_uint8(Visitor *v, uint8_t *obj, const char *name, Error **errp)
value = *obj;
v->type_int(v, &value, name, errp);
if (value < 0 || value > UINT8_MAX) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null",
- "uint8_t");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+ name ? name : "null", "uint8_t");
return;
}
*obj = value;
@@ -128,8 +128,8 @@ void visit_type_uint16(Visitor *v, uint16_t *obj, const char *name, Error **errp
value = *obj;
v->type_int(v, &value, name, errp);
if (value < 0 || value > UINT16_MAX) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null",
- "uint16_t");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+ name ? name : "null", "uint16_t");
return;
}
*obj = value;
@@ -146,8 +146,8 @@ void visit_type_uint32(Visitor *v, uint32_t *obj, const char *name, Error **errp
value = *obj;
v->type_int(v, &value, name, errp);
if (value < 0 || value > UINT32_MAX) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null",
- "uint32_t");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+ name ? name : "null", "uint32_t");
return;
}
*obj = value;
@@ -177,8 +177,8 @@ void visit_type_int8(Visitor *v, int8_t *obj, const char *name, Error **errp)
value = *obj;
v->type_int(v, &value, name, errp);
if (value < INT8_MIN || value > INT8_MAX) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null",
- "int8_t");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+ name ? name : "null", "int8_t");
return;
}
*obj = value;
@@ -195,8 +195,8 @@ void visit_type_int16(Visitor *v, int16_t *obj, const char *name, Error **errp)
value = *obj;
v->type_int(v, &value, name, errp);
if (value < INT16_MIN || value > INT16_MAX) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null",
- "int16_t");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+ name ? name : "null", "int16_t");
return;
}
*obj = value;
@@ -213,8 +213,8 @@ void visit_type_int32(Visitor *v, int32_t *obj, const char *name, Error **errp)
value = *obj;
v->type_int(v, &value, name, errp);
if (value < INT32_MIN || value > INT32_MAX) {
- error_set(errp, QERR_INVALID_PARAMETER_VALUE, name ? name : "null",
- "int32_t");
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
+ name ? name : "null", "int32_t");
return;
}
*obj = value;
@@ -271,7 +271,7 @@ void output_type_enum(Visitor *v, int *obj, const char * const strings[],
assert(strings);
while (strings[i++] != NULL);
if (value < 0 || value >= i - 1) {
- error_set(errp, QERR_INVALID_PARAMETER, name ? name : "null");
+ error_setg(errp, QERR_INVALID_PARAMETER, name ? name : "null");
return;
}
@@ -303,7 +303,7 @@ void input_type_enum(Visitor *v, int *obj, const char * const strings[],
}
if (strings[value] == NULL) {
- error_set(errp, QERR_INVALID_PARAMETER, enum_str);
+ error_setg(errp, QERR_INVALID_PARAMETER, enum_str);
g_free(enum_str);
return;
}