From nobody Mon Feb 9 01:16:16 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 1503091388216543.7786684448411; Fri, 18 Aug 2017 14:23:08 -0700 (PDT) Received: from localhost ([::1]:34185 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1diojS-0003qN-Pv for importer@patchew.org; Fri, 18 Aug 2017 17:23:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dioca-00071E-0x for qemu-devel@nongnu.org; Fri, 18 Aug 2017 17:16:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1diocW-0000qS-QQ for qemu-devel@nongnu.org; Fri, 18 Aug 2017 17:15:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39378) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1diocW-0000oF-Ex; Fri, 18 Aug 2017 17:15:56 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 381B513A9D; Fri, 18 Aug 2017 21:15:55 +0000 (UTC) Received: from red.redhat.com (ovpn-122-167.rdu2.redhat.com [10.10.122.167]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2E7F5C7A2; Fri, 18 Aug 2017 21:15:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 381B513A9D Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=eblake@redhat.com From: Eric Blake To: qemu-devel@nongnu.org Date: Fri, 18 Aug 2017 16:15:38 -0500 Message-Id: <20170818211542.5380-10-eblake@redhat.com> In-Reply-To: <20170818211542.5380-1-eblake@redhat.com> References: <20170818211542.5380-1-eblake@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 18 Aug 2017 21:15:55 +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 v5 09/13] libqtest: Shorten a couple more qtest_* functions 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: Alexander Graf , "open list:sPAPR" , armbru@redhat.com, David Gibson 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" qtest_rtas_call() and qtest_big_endian() did not have a short version with an implied global_qtest; but changing these two functions fits with the theme of the previous patch. It doesn't hurt that we are now no longer ambiguous with the qtest_rtas_call() of include/hw/ppc/spapr_rtos.h. Signed-off-by: Eric Blake --- tests/libqos/virtio.h | 2 +- tests/libqtest.h | 18 ++++++++---------- tests/libqtest.c | 13 ++++++------- tests/libqos/rtas.c | 3 +-- 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/tests/libqos/virtio.h b/tests/libqos/virtio.h index 8fbcd1869c..7bca1b418a 100644 --- a/tests/libqos/virtio.h +++ b/tests/libqos/virtio.h @@ -93,7 +93,7 @@ struct QVirtioBus { static inline bool qvirtio_is_big_endian(QVirtioDevice *d) { /* FIXME: virtio 1.0 is always little-endian */ - return qtest_big_endian(global_qtest); + return big_endian(); } static inline uint32_t qvring_size(uint32_t num, uint32_t align) diff --git a/tests/libqtest.h b/tests/libqtest.h index 3ae570927a..28945b3f7f 100644 --- a/tests/libqtest.h +++ b/tests/libqtest.h @@ -338,19 +338,17 @@ uint64_t qtest_readq(QTestState *s, uint64_t addr); void qtest_memread(QTestState *s, uint64_t addr, void *data, size_t size); /** - * qtest_rtas_call: - * @s: #QTestState instance to operate on. + * rtas_call: * @name: name of the command to call. * @nargs: Number of args. * @args: Guest address to read args from. * @nret: Number of return value. * @ret: Guest address to write return values to. * - * Call an RTAS function + * Call an RTAS function, using #global_qtest */ -uint64_t qtest_rtas_call(QTestState *s, const char *name, - uint32_t nargs, uint64_t args, - uint32_t nret, uint64_t ret); +uint64_t rtas_call(const char *name, uint32_t nargs, uint64_t args, + uint32_t nret, uint64_t ret); /** * qtest_bufread: @@ -430,12 +428,12 @@ int64_t qtest_clock_step(QTestState *s, int64_t step); int64_t qtest_clock_set(QTestState *s, int64_t val); /** - * qtest_big_endian: - * @s: QTestState instance to operate on. + * big_endian: * - * Returns: True if the architecture under test has a big endian configura= tion. + * Returns: True if the architecture under test, via #global_qtest, + * has a big endian configuration. */ -bool qtest_big_endian(QTestState *s); +bool big_endian(void); /** * qtest_get_arch: diff --git a/tests/libqtest.c b/tests/libqtest.c index b6dd26e54a..261d86df5a 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -816,13 +816,12 @@ void qtest_memread(QTestState *s, uint64_t addr, void= *data, size_t size) g_strfreev(args); } -uint64_t qtest_rtas_call(QTestState *s, const char *name, - uint32_t nargs, uint64_t args, - uint32_t nret, uint64_t ret) +uint64_t rtas_call(const char *name, uint32_t nargs, uint64_t args, + uint32_t nret, uint64_t ret) { - qtest_sendf(s, "rtas %s %u 0x%"PRIx64" %u 0x%"PRIx64"\n", + qtest_sendf(global_qtest, "rtas %s %u 0x%"PRIx64" %u 0x%"PRIx64"\n", name, nargs, args, nret, ret); - qtest_rsp(s, 0); + qtest_rsp(global_qtest, 0); return 0; } @@ -947,9 +946,9 @@ char *hmp(const char *fmt, ...) return ret; } -bool qtest_big_endian(QTestState *s) +bool big_endian(void) { - return s->big_endian; + return global_qtest->big_endian; } void qtest_cb_for_every_machine(void (*cb)(const char *machine)) diff --git a/tests/libqos/rtas.c b/tests/libqos/rtas.c index 0269803ce0..e7ba7ab18f 100644 --- a/tests/libqos/rtas.c +++ b/tests/libqos/rtas.c @@ -37,8 +37,7 @@ static uint64_t qrtas_call(QGuestAllocator *alloc, const = char *name, target_ret =3D guest_alloc(alloc, nret * sizeof(uint32_t)); qrtas_copy_args(target_args, nargs, args); - res =3D qtest_rtas_call(global_qtest, name, - nargs, target_args, nret, target_ret); + res =3D rtas_call(name, nargs, target_args, nret, target_ret); qrtas_copy_ret(target_ret, nret, ret); guest_free(alloc, target_ret); --=20 2.13.5