From 94c3db85b4cc1d4e078859834a761bcc9d988780 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 29 Jun 2012 14:25:01 -0300 Subject: qapi: input_type_enum(): fix error message 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 Reviewed-by: Amos Kong --- qapi/qapi-visit-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'qapi') diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c index ffffbf79aa..705eca90aa 100644 --- a/qapi/qapi-visit-core.c +++ b/qapi/qapi-visit-core.c @@ -298,7 +298,7 @@ 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; } -- cgit v1.2.1