From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37432) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ci6bg-0004U6-Lg for qemu-devel@nongnu.org; Sun, 26 Feb 2017 16:43:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ci6bd-0004Mc-NE for qemu-devel@nongnu.org; Sun, 26 Feb 2017 16:43:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35830) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ci6bd-0004LU-Gz for qemu-devel@nongnu.org; Sun, 26 Feb 2017 16:43:49 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A26A161B86 for ; Sun, 26 Feb 2017 21:43:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1QLhmik001815 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 26 Feb 2017 16:43:49 -0500 From: Markus Armbruster Date: Sun, 26 Feb 2017 22:43:27 +0100 Message-Id: <1488145424-14974-10-git-send-email-armbru@redhat.com> In-Reply-To: <1488145424-14974-1-git-send-email-armbru@redhat.com> References: <1488145424-14974-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v2 09/26] qapi: Improve a QObject input visitor error message List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The QObject input visitor has three error message formats: * Parameter '%s' is missing * "Invalid parameter type for '%s', expected: %s" * "QMP input object member '%s' is unexpected" The '%s' are member names (or "null", but I'll fix that later). The last error message calls the thing "QMP input object member" instead of "parameter". Misleading when the visitor is used on QObjects that don't come from QMP. Change it to "Parameter '%s' is unexpected". Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- qapi/qobject-input-visitor.c | 3 +-- tests/test-qga.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/qapi/qobject-input-visitor.c b/qapi/qobject-input-visitor.c index ed6c24c..f3b6713 100644 --- a/qapi/qobject-input-visitor.c +++ b/qapi/qobject-input-visitor.c @@ -140,8 +140,7 @@ static void qobject_input_check_struct(Visitor *v, Error **errp) g_hash_table_iter_init(&iter, top_ht); if (g_hash_table_iter_next(&iter, (void **)&key, NULL)) { - error_setg(errp, "QMP input object member '%s' is unexpected", - key); + error_setg(errp, "Parameter '%s' is unexpected", key); } } } diff --git a/tests/test-qga.c b/tests/test-qga.c index 868b02a..ae97b57 100644 --- a/tests/test-qga.c +++ b/tests/test-qga.c @@ -213,7 +213,7 @@ static void test_qga_invalid_args(gconstpointer fix) desc = qdict_get_try_str(error, "desc"); g_assert_cmpstr(class, ==, "GenericError"); - g_assert_cmpstr(desc, ==, "QMP input object member 'foo' is unexpected"); + g_assert_cmpstr(desc, ==, "Parameter 'foo' is unexpected"); QDECREF(ret); } -- 2.7.4