From nobody Mon Feb 9 04:31:55 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488544736098594.922680605396; Fri, 3 Mar 2017 04:38:56 -0800 (PST) Received: from localhost ([::1]:57521 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjmU2-0003fv-FN for importer@patchew.org; Fri, 03 Mar 2017 07:38:54 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42372) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cjmOF-0007uY-2K for qemu-devel@nongnu.org; Fri, 03 Mar 2017 07:32:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cjmOD-0007yy-Q6 for qemu-devel@nongnu.org; Fri, 03 Mar 2017 07:32:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51204) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cjmOD-0007yF-Kl for qemu-devel@nongnu.org; Fri, 03 Mar 2017 07:32:53 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (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 CF53BC05B1E4 for ; Fri, 3 Mar 2017 12:32:53 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-55.ams2.redhat.com [10.36.116.55]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v23CWqXw020824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Mar 2017 07:32:53 -0500 Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1B7FB11385FC; Fri, 3 Mar 2017 13:32:49 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Fri, 3 Mar 2017 13:32:31 +0100 Message-Id: <1488544368-30622-12-git-send-email-armbru@redhat.com> In-Reply-To: <1488544368-30622-1-git-send-email-armbru@redhat.com> References: <1488544368-30622-1-git-send-email-armbru@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 03 Mar 2017 12:32:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v4 11/28] qapi: Improve a QObject input visitor error message X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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, Erro= r **errp) =20 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 unexpect= ed", - 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 =3D qdict_get_try_str(error, "desc"); =20 g_assert_cmpstr(class, =3D=3D, "GenericError"); - g_assert_cmpstr(desc, =3D=3D, "QMP input object member 'foo' is unexpe= cted"); + g_assert_cmpstr(desc, =3D=3D, "Parameter 'foo' is unexpected"); =20 QDECREF(ret); } --=20 2.7.4