Skip to content

Commit

Permalink
qapi: input_type_enum(): fix error message
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Amos Kong <[email protected]>
  • Loading branch information
Luiz Capitulino committed Jul 13, 2012
1 parent f5b0d93 commit 94c3db8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qapi/qapi-visit-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 94c3db8

Please sign in to comment.