From patchwork Fri Jun 29 17:40:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 168234 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 77BE4B6FA0 for ; Sat, 30 Jun 2012 03:40:20 +1000 (EST) Received: from localhost ([::1]:34612 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkfB4-0003Jm-C9 for incoming@patchwork.ozlabs.org; Fri, 29 Jun 2012 13:40:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkfAw-0003Gj-EC for qemu-devel@nongnu.org; Fri, 29 Jun 2012 13:40:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SkfAu-0002zw-Os for qemu-devel@nongnu.org; Fri, 29 Jun 2012 13:40:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34137) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SkfAu-0002yy-G5 for qemu-devel@nongnu.org; Fri, 29 Jun 2012 13:40:08 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5THdVPw023141 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 29 Jun 2012 13:39:31 -0400 Received: from doriath.home (ovpn-113-119.phx2.redhat.com [10.3.113.119]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q5THdUh5023704; Fri, 29 Jun 2012 13:39:30 -0400 Date: Fri, 29 Jun 2012 14:40:01 -0300 From: Luiz Capitulino To: qemu-devel Message-ID: <20120629144001.0b388b49@doriath.home> Organization: Red Hat Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: mdroth@linux.vnet.ibm.com Subject: [Qemu-devel] [PATCH] qapi: input_type_enum(): fix error message X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@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 --- 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 @@ -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; }