From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Spj6z-0000A3-7B for qemu-devel@nongnu.org; Fri, 13 Jul 2012 12:53:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Spj6y-0006iJ-7W for qemu-devel@nongnu.org; Fri, 13 Jul 2012 12:53:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Spj6x-0006i8-QJ for qemu-devel@nongnu.org; Fri, 13 Jul 2012 12:53:00 -0400 From: Luiz Capitulino Date: Fri, 13 Jul 2012 13:53:21 -0300 Message-Id: <1342198402-20666-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1342198402-20666-1-git-send-email-lcapitulino@redhat.com> References: <1342198402-20666-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 2/3] qapi: input_type_enum(): fix error message List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aliguori@us.ibm.com Cc: qemu-devel@nongnu.org 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(-) 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 @@ -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; } -- 1.7.11.1.116.g8228a23