From nobody Mon Feb 9 12:09:19 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.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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15051509869240.72701752609305; Mon, 11 Sep 2017 10:29:46 -0700 (PDT) Received: from localhost ([::1]:59359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drSWn-0007GV-2m for importer@patchew.org; Mon, 11 Sep 2017 13:29:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drSO4-000727-K0 for qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:20:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drSNz-00010K-Kp for qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:20:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35762) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1drSNz-0000zp-68 for qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:20:39 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 51747C0C0567 for ; Mon, 11 Sep 2017 17:20:38 +0000 (UTC) Received: from red.redhat.com (ovpn-120-44.rdu2.redhat.com [10.10.120.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 731525D9CA; Mon, 11 Sep 2017 17:20:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 51747C0C0567 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=eblake@redhat.com From: Eric Blake To: qemu-devel@nongnu.org Date: Mon, 11 Sep 2017 12:19:51 -0500 Message-Id: <20170911172022.4738-8-eblake@redhat.com> In-Reply-To: <20170911172022.4738-1-eblake@redhat.com> References: <20170911172022.4738-1-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 11 Sep 2017 17:20:38 +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 v7 07/38] libqtest: Inline qtest_query_target_endianness() 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: pbonzini@redhat.com, thuth@redhat.com, armbru@redhat.com 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" There was only one caller; it's easier to inline things. (It trades one forward declaration for two others, but it's not worth the additional churn of topological sorting, even though that would be possible.) Signed-off-by: Eric Blake Reviewed-by: Thomas Huth --- v7: Drop the topological sorting --- tests/libqtest.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/tests/libqtest.c b/tests/libqtest.c index 95d4159b38..1710d63276 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -49,7 +49,9 @@ static struct sigaction sigact_old; g_assert_cmpint(ret, !=3D, -1); \ } while (0) -static int qtest_query_target_endianness(QTestState *s); +static void qtest_sendf(QTestState *s, const char *fmt, ...) + GCC_FMT_ATTR(2, 3); +static gchar **qtest_rsp(QTestState *s, int expected_args); static int init_socket(const char *socket_path) { @@ -158,6 +160,7 @@ QTestState *qtest_init_without_qmp_handshake(const char= *extra_args) gchar *qmp_socket_path; gchar *command; const char *qemu_binary; + gchar **args; qemu_binary =3D getenv("QTEST_QEMU_BINARY"); if (!qemu_binary) { @@ -221,8 +224,11 @@ QTestState *qtest_init_without_qmp_handshake(const cha= r *extra_args) } /* ask endianness of the target */ - - s->big_endian =3D qtest_query_target_endianness(s); + qtest_sendf(s, "endianness\n"); + args =3D qtest_rsp(s, 1); + g_assert(strcmp(args[1], "big") =3D=3D 0 || strcmp(args[1], "little") = =3D=3D 0); + s->big_endian =3D strcmp(args[1], "big") =3D=3D 0; + g_strfreev(args); return s; } @@ -367,20 +373,6 @@ redo: return words; } -static int qtest_query_target_endianness(QTestState *s) -{ - gchar **args; - int big_endian; - - qtest_sendf(s, "endianness\n"); - args =3D qtest_rsp(s, 1); - g_assert(strcmp(args[1], "big") =3D=3D 0 || strcmp(args[1], "little") = =3D=3D 0); - big_endian =3D strcmp(args[1], "big") =3D=3D 0; - g_strfreev(args); - - return big_endian; -} - typedef struct { JSONMessageParser parser; QDict *response; --=20 2.13.5