From nobody Sun Feb 8 22:07: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; 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 1545066532257242.56307655474507; Mon, 17 Dec 2018 09:08:52 -0800 (PST) Received: from localhost ([::1]:47726 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYvkU-0005Hl-0c for importer@patchew.org; Mon, 17 Dec 2018 11:28:06 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYveS-0000Wk-EA for qemu-devel@nongnu.org; Mon, 17 Dec 2018 11:21:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYveQ-0000PW-59 for qemu-devel@nongnu.org; Mon, 17 Dec 2018 11:21:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51408) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gYveO-0000HY-Du for qemu-devel@nongnu.org; Mon, 17 Dec 2018 11:21:49 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2A43889ADC for ; Mon, 17 Dec 2018 16:21:45 +0000 (UTC) Received: from thuth.com (dhcp-200-199.str.redhat.com [10.33.200.199]) by smtp.corp.redhat.com (Postfix) with ESMTP id 54D011001942; Mon, 17 Dec 2018 16:21:44 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Mon, 17 Dec 2018 17:21:25 +0100 Message-Id: <1545063690-10116-9-git-send-email-thuth@redhat.com> In-Reply-To: <1545063690-10116-1-git-send-email-thuth@redhat.com> References: <1545063690-10116-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 17 Dec 2018 16:21:45 +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] [PULL 08/13] tests/machine-none: Make test independent of global_qtest 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: Laurent Vivier , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Apart from using qmp() in one spot, this test does not have any dependencies to the global_qtest variable, so we can simply get rid of it here by replacing the qmp() with qtest_qmp(). Reviewed-by: Eric Blake Signed-off-by: Thomas Huth --- tests/machine-none-test.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/machine-none-test.c b/tests/machine-none-test.c index 2b3b750..4c6d470 100644 --- a/tests/machine-none-test.c +++ b/tests/machine-none-test.c @@ -75,6 +75,7 @@ static void test_machine_cpu_cli(void) QDict *response; const char *arch =3D qtest_get_arch(); const char *cpu_model =3D get_cpu_model_by_arch(arch); + QTestState *qts; =20 if (!cpu_model) { if (!(!strcmp(arch, "microblaze") || !strcmp(arch, "microblazeel")= )) { @@ -83,13 +84,13 @@ static void test_machine_cpu_cli(void) } return; /* TODO: die here to force all targets have a test */ } - global_qtest =3D qtest_initf("-machine none -cpu '%s'", cpu_model); + qts =3D qtest_initf("-machine none -cpu '%s'", cpu_model); =20 - response =3D qmp("{ 'execute': 'quit' }"); + response =3D qtest_qmp(qts, "{ 'execute': 'quit' }"); g_assert(qdict_haskey(response, "return")); qobject_unref(response); =20 - qtest_quit(global_qtest); + qtest_quit(qts); } =20 int main(int argc, char **argv) --=20 1.8.3.1