29 Jun 2012 19:40
[PATCH] qapi: input_type_enum(): fix error message
Luiz Capitulino <lcapitulino <at> redhat.com>
2012-06-29 17:40:01 GMT
2012-06-29 17:40:01 GMT
The enum string is pointed to by 'enum_str' not 'name'. This bug
causes the error message to be:
{ "error": { "class": "InvalidParameter",
"desc": "Invalid parameter 'null'",
"data": { "name": "null" } } }
Signed-off-by: Luiz Capitulino <lcapitulino <at> redhat.com>
---
I've caught this while reviewing the sendkey conversion series. Not sure if
any in tree code can trigger this.
qapi/qapi-visit-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c
index ffffbf7..705eca9 100644
--- a/qapi/qapi-visit-core.c
+++ b/qapi/qapi-visit-core.c
<at> <at> -298,7 +298,7 <at> <at> void input_type_enum(Visitor *v, int *obj, const char *strings[],
}
if (strings[value] == NULL) {
- error_set(errp, QERR_INVALID_PARAMETER, name ? name : "null");
+ error_set(errp, QERR_INVALID_PARAMETER, enum_str);
g_free(enum_str);
return;
}
--
--
(Continue reading)
RSS Feed