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 <lcapitulino@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
This commit is contained in:
Luiz Capitulino 2012-06-29 14:25:01 -03:00
parent f5b0d93bcb
commit 94c3db85b4

View file

@ -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;
}