From nobody Wed Nov 5 05:21:15 2025 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.zohomail.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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1532705876801661.4009330055388; Fri, 27 Jul 2018 08:37:56 -0700 (PDT) Received: from localhost ([::1]:41898 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fj4oV-00029K-Gj for importer@patchew.org; Fri, 27 Jul 2018 11:37:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42438) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fj4Ri-0006I8-J6 for qemu-devel@nongnu.org; Fri, 27 Jul 2018 11:14:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fj4Re-0000L0-Fw for qemu-devel@nongnu.org; Fri, 27 Jul 2018 11:14:22 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59462 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fj4Re-000093-Bg for qemu-devel@nongnu.org; Fri, 27 Jul 2018 11:14:18 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C4064023475; Fri, 27 Jul 2018 15:14:02 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-116-135.ams2.redhat.com [10.36.116.135]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 41CF62156701; Fri, 27 Jul 2018 15:14:02 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B42AB11385D0; Fri, 27 Jul 2018 17:13:59 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Fri, 27 Jul 2018 17:13:43 +0200 Message-Id: <20180727151359.29061-8-armbru@redhat.com> In-Reply-To: <20180727151359.29061-1-armbru@redhat.com> References: <20180727151359.29061-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 27 Jul 2018 15:14:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 27 Jul 2018 15:14:02 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'armbru@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 07/23] libqtest: Simplify qmp_fd_vsend() a bit 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: , Cc: thuth@redhat.com, f4bug@amsat.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Blake --- tests/libqtest.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index c2c08a890c..3bfb062fcb 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -488,24 +488,20 @@ QDict *qtest_qmp_receive(QTestState *s) */ void qmp_fd_vsend(int fd, const char *fmt, va_list ap) { - va_list ap_copy; QObject *qobj; =20 - /* qobject_from_jsonv() silently eats leading 0xff as invalid - * JSON, but we want to test sending them over the wire to force - * resyncs */ + /* + * qobject_from_vjsonf_nofail() chokes on leading 0xff as invalid + * JSON, but tests/test-qga.c needs to send that to test QGA + * synchronization + */ if (*fmt =3D=3D '\377') { socket_send(fd, fmt, 1); fmt++; } =20 - /* Going through qobject ensures we escape strings properly. - * This seemingly unnecessary copy is required in case va_list - * is an array type. - */ - va_copy(ap_copy, ap); - qobj =3D qobject_from_jsonv(fmt, &ap_copy, &error_abort); - va_end(ap_copy); + /* Going through qobject ensures we escape strings properly */ + qobj =3D qobject_from_vjsonf_nofail(fmt, ap); =20 /* No need to send anything for an empty QObject. */ if (qobj) { --=20 2.17.1