From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390115; cv=none; d=zoho.com; s=zohoarc; b=lE71WfN6ggiEbCrlXUqrb9uQb1dbUTBz2De/0GKkRuCWZGoH/40G6z7MLnZKhX3HaCAnrg9BPrDp/yp65ny0baCCAhN8GYnq9XzD0MGotn9EhtkKQ/tcmjfJcyzX/DLVRWS60UqRCShPvaoInu5dExiK5rwSmIHVY6Z+jnhDnuc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390115; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=3JDVffwRuRQdFDe/CBl+2y2/I9nOH9Qacl6sJGYhDH8=; b=N/3qVkqDK0FHiApzGf4SPllH33yKZLYugBPw7D+LsaC8T2/7qt/SdqhrzmxnOlQpWPTRsBJL/F9KJOWtmO/BfvZO5L6uZO2pnZeh8Kpx/w+L9qV8V/cbKQyVI2bdQtMimUM4HfryNXvvfWU82G5dzeySFZvlQRRDtsEiNDQagDM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390115029393.0096204626303; Thu, 9 May 2019 01:21:55 -0700 (PDT) Received: from localhost ([127.0.0.1]:50261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeJF-0004YE-GD for importer@patchew.org; Thu, 09 May 2019 04:21:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHI-0001gP-R2 for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHH-0000GP-P1 for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58682) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHH-0000FV-JI for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:43 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF019309B164; Thu, 9 May 2019 08:19:42 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id F13205B680; Thu, 9 May 2019 08:19:36 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:17 +0200 Message-Id: <20190509081930.19081-2-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 09 May 2019 08:19:42 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 01/14] tests: Force Python I/O encoding for check-qapi-schema 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Eduardo Habkost test-qapi.py doesn't force a specific encoding for stderr or stdout, but the reference files used by check-qapi-schema are in UTF-8. This breaks check-qapi-schema under certain circumstances (e.g. if using the C locale and Python < 3.7). We need to make sure test-qapi.py always generate UTF-8 output somehow. On Python 3.7+ we can do it using `sys.stdout.reconfigure(...)`, but we need a solution that works with older Python versions. Instead of trying a hack like reopening sys.stdout and sys.stderr, we can just tell Python to use UTF-8 for I/O encoding when running test-qapi.py. Do it by setting PYTHONIOENCODING. Reported-by: Thomas Huth Tested-by: Thomas Huth Signed-off-by: Eduardo Habkost Message-Id: <20190506213817.14344-1-ehabkost@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e Tested-by: Alex Benn=C3=A9e Signed-off-by: Thomas Huth --- tests/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 7c8b9c84b2..af88ab6f8b 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -1103,7 +1103,7 @@ check-tests/qemu-iotests-quick.sh: tests/qemu-iotests= -quick.sh qemu-img$(EXESUF) .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y)) $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/= %.json $(call quiet-command, PYTHONPATH=3D$(SRC_PATH)/scripts \ - $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qapi.py \ + PYTHONIOENCODING=3Dutf-8 $(PYTHON) $(SRC_PATH)/tests/qapi-schema/test-qa= pi.py \ $^ >$*.test.out 2>$*.test.err; \ echo $$? >$*.test.exit, \ "TEST","$*.out") --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390264; cv=none; d=zoho.com; s=zohoarc; b=i3SdGNLIT/B59sz0ULs49J6SNegq2x42OmMoaQ+lVpaGo2ajHNbSPo6V+uhZ9yr9SFvgJij5wFiXNmltC84ifvSQVyGGDyXzLQe8vZPBNpmTpTzrAmttGa66eSwr00D+vrrEVoGdQApchI3Yfn3uRStLOqahFUMl2ybO/7+R/qw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390264; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=smLc/cB3GfeekT7BVLAZ1UzsOg7tbrZav6UVyO6GFiM=; b=S/LcIq5H7dBzE+kMf49483maeUTF8RkG0jPWoKyGhS+Jp+hJkLQW/7iiDLgRGRxEgRqiR3RQeT3VYmEp+BboVXY6uGpAh9rtYQPkPWD+MzCtUwy1HuraWNXOUWiOw/nHF3Bl3NRaYyKY+nwEsk858X0z8ot0dq36NKbdD1fvPMU= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390264548973.2296391723829; Thu, 9 May 2019 01:24:24 -0700 (PDT) Received: from localhost ([127.0.0.1]:50286 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeLf-0006no-Ct for importer@patchew.org; Thu, 09 May 2019 04:24:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHK-0001kz-KX for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHJ-0000HQ-9N for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8065) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHJ-0000H0-03 for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:45 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 583B6307D910; Thu, 9 May 2019 08:19:44 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BB085B680; Thu, 9 May 2019 08:19:43 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:18 +0200 Message-Id: <20190509081930.19081-3-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Thu, 09 May 2019 08:19:44 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 02/14] tests/tco: 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Pass around the QTestState in the TestData, so we do not need the global_qtest variable here anymore. Message-Id: <20190409085245.31548-2-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/tco-test.c | 63 ++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/tests/tco-test.c b/tests/tco-test.c index f89a42cdcc..254f735370 100644 --- a/tests/tco-test.c +++ b/tests/tco-test.c @@ -45,13 +45,14 @@ typedef struct { QPCIDevice *dev; QPCIBar tco_io_bar; QPCIBus *bus; + QTestState *qts; } TestData; =20 static void test_end(TestData *d) { g_free(d->dev); qpci_free_pc(d->bus); - qtest_end(); + qtest_quit(d->qts); } =20 static void test_init(TestData *d) @@ -61,7 +62,6 @@ static void test_init(TestData *d) qs =3D qtest_initf("-machine q35 %s %s", d->noreboot ? "" : "-global ICH9-LPC.noreboot=3Dfalse= ", !d->args ? "" : d->args); - global_qtest =3D qs; qtest_irq_intercept_in(qs, "ioapic"); =20 d->bus =3D qpci_new_pc(qs, NULL); @@ -78,6 +78,7 @@ static void test_init(TestData *d) qpci_config_writel(d->dev, ICH9_LPC_RCBA, RCBA_BASE_ADDR | 0x1); =20 d->tco_io_bar =3D qpci_legacy_iomap(d->dev, PM_IO_BASE_ADDR + 0x60); + d->qts =3D qs; } =20 static void stop_tco(const TestData *d) @@ -115,17 +116,17 @@ static void clear_tco_status(const TestData *d) qpci_io_writew(d->dev, d->tco_io_bar, TCO2_STS, 0x0004); } =20 -static void reset_on_second_timeout(bool enable) +static void reset_on_second_timeout(const TestData *td, bool enable) { uint32_t val; =20 - val =3D readl(RCBA_BASE_ADDR + ICH9_CC_GCS); + val =3D qtest_readl(td->qts, RCBA_BASE_ADDR + ICH9_CC_GCS); if (enable) { val &=3D ~ICH9_CC_GCS_NO_REBOOT; } else { val |=3D ICH9_CC_GCS_NO_REBOOT; } - writel(RCBA_BASE_ADDR + ICH9_CC_GCS, val); + qtest_writel(td->qts, RCBA_BASE_ADDR + ICH9_CC_GCS, val); } =20 static void test_tco_defaults(void) @@ -171,11 +172,11 @@ static void test_tco_timeout(void) =20 stop_tco(&d); clear_tco_status(&d); - reset_on_second_timeout(false); + reset_on_second_timeout(&d, false); set_tco_timeout(&d, ticks); load_tco(&d); start_tco(&d); - clock_step(ticks * TCO_TICK_NSEC); + qtest_clock_step(d.qts, ticks * TCO_TICK_NSEC); =20 /* test first timeout */ val =3D qpci_io_readw(d.dev, d.tco_io_bar, TCO1_STS); @@ -190,7 +191,7 @@ static void test_tco_timeout(void) g_assert(ret =3D=3D 0); =20 /* test second timeout */ - clock_step(ticks * TCO_TICK_NSEC); + qtest_clock_step(d.qts, ticks * TCO_TICK_NSEC); val =3D qpci_io_readw(d.dev, d.tco_io_bar, TCO1_STS); ret =3D val & TCO_TIMEOUT ? 1 : 0; g_assert(ret =3D=3D 1); @@ -215,18 +216,18 @@ static void test_tco_max_timeout(void) =20 stop_tco(&d); clear_tco_status(&d); - reset_on_second_timeout(false); + reset_on_second_timeout(&d, false); set_tco_timeout(&d, ticks); load_tco(&d); start_tco(&d); - clock_step(((ticks & TCO_TMR_MASK) - 1) * TCO_TICK_NSEC); + qtest_clock_step(d.qts, ((ticks & TCO_TMR_MASK) - 1) * TCO_TICK_NSEC); =20 val =3D qpci_io_readw(d.dev, d.tco_io_bar, TCO_RLD); g_assert_cmpint(val & TCO_RLD_MASK, =3D=3D, 1); val =3D qpci_io_readw(d.dev, d.tco_io_bar, TCO1_STS); ret =3D val & TCO_TIMEOUT ? 1 : 0; g_assert(ret =3D=3D 0); - clock_step(TCO_TICK_NSEC); + qtest_clock_step(d.qts, TCO_TICK_NSEC); val =3D qpci_io_readw(d.dev, d.tco_io_bar, TCO1_STS); ret =3D val & TCO_TIMEOUT ? 1 : 0; g_assert(ret =3D=3D 1); @@ -235,9 +236,9 @@ static void test_tco_max_timeout(void) test_end(&d); } =20 -static QDict *get_watchdog_action(void) +static QDict *get_watchdog_action(const TestData *td) { - QDict *ev =3D qmp_eventwait_ref("WATCHDOG"); + QDict *ev =3D qtest_qmp_eventwait_ref(td->qts, "WATCHDOG"); QDict *data; =20 data =3D qdict_get_qdict(ev, "data"); @@ -258,12 +259,12 @@ static void test_tco_second_timeout_pause(void) =20 stop_tco(&td); clear_tco_status(&td); - reset_on_second_timeout(true); + reset_on_second_timeout(&td, true); set_tco_timeout(&td, TCO_SECS_TO_TICKS(16)); load_tco(&td); start_tco(&td); - clock_step(ticks * TCO_TICK_NSEC * 2); - ad =3D get_watchdog_action(); + qtest_clock_step(td.qts, ticks * TCO_TICK_NSEC * 2); + ad =3D get_watchdog_action(&td); g_assert(!strcmp(qdict_get_str(ad, "action"), "pause")); qobject_unref(ad); =20 @@ -283,12 +284,12 @@ static void test_tco_second_timeout_reset(void) =20 stop_tco(&td); clear_tco_status(&td); - reset_on_second_timeout(true); + reset_on_second_timeout(&td, true); set_tco_timeout(&td, TCO_SECS_TO_TICKS(16)); load_tco(&td); start_tco(&td); - clock_step(ticks * TCO_TICK_NSEC * 2); - ad =3D get_watchdog_action(); + qtest_clock_step(td.qts, ticks * TCO_TICK_NSEC * 2); + ad =3D get_watchdog_action(&td); g_assert(!strcmp(qdict_get_str(ad, "action"), "reset")); qobject_unref(ad); =20 @@ -308,12 +309,12 @@ static void test_tco_second_timeout_shutdown(void) =20 stop_tco(&td); clear_tco_status(&td); - reset_on_second_timeout(true); + reset_on_second_timeout(&td, true); set_tco_timeout(&td, ticks); load_tco(&td); start_tco(&td); - clock_step(ticks * TCO_TICK_NSEC * 2); - ad =3D get_watchdog_action(); + qtest_clock_step(td.qts, ticks * TCO_TICK_NSEC * 2); + ad =3D get_watchdog_action(&td); g_assert(!strcmp(qdict_get_str(ad, "action"), "shutdown")); qobject_unref(ad); =20 @@ -333,12 +334,12 @@ static void test_tco_second_timeout_none(void) =20 stop_tco(&td); clear_tco_status(&td); - reset_on_second_timeout(true); + reset_on_second_timeout(&td, true); set_tco_timeout(&td, ticks); load_tco(&td); start_tco(&td); - clock_step(ticks * TCO_TICK_NSEC * 2); - ad =3D get_watchdog_action(); + qtest_clock_step(td.qts, ticks * TCO_TICK_NSEC * 2); + ad =3D get_watchdog_action(&td); g_assert(!strcmp(qdict_get_str(ad, "action"), "none")); qobject_unref(ad); =20 @@ -358,7 +359,7 @@ static void test_tco_ticks_counter(void) =20 stop_tco(&d); clear_tco_status(&d); - reset_on_second_timeout(false); + reset_on_second_timeout(&d, false); set_tco_timeout(&d, ticks); load_tco(&d); start_tco(&d); @@ -366,7 +367,7 @@ static void test_tco_ticks_counter(void) do { rld =3D qpci_io_readw(d.dev, d.tco_io_bar, TCO_RLD) & TCO_RLD_MASK; g_assert_cmpint(rld, =3D=3D, ticks); - clock_step(TCO_TICK_NSEC); + qtest_clock_step(d.qts, TCO_TICK_NSEC); ticks--; } while (!(qpci_io_readw(d.dev, d.tco_io_bar, TCO1_STS) & TCO_TIMEOUT)= ); =20 @@ -405,11 +406,11 @@ static void test_tco1_status_bits(void) =20 stop_tco(&d); clear_tco_status(&d); - reset_on_second_timeout(false); + reset_on_second_timeout(&d, false); set_tco_timeout(&d, ticks); load_tco(&d); start_tco(&d); - clock_step(ticks * TCO_TICK_NSEC); + qtest_clock_step(d.qts, ticks * TCO_TICK_NSEC); =20 qpci_io_writeb(d.dev, d.tco_io_bar, TCO_DAT_IN, 0); qpci_io_writeb(d.dev, d.tco_io_bar, TCO_DAT_OUT, 0); @@ -434,11 +435,11 @@ static void test_tco2_status_bits(void) =20 stop_tco(&d); clear_tco_status(&d); - reset_on_second_timeout(true); + reset_on_second_timeout(&d, true); set_tco_timeout(&d, ticks); load_tco(&d); start_tco(&d); - clock_step(ticks * TCO_TICK_NSEC * 2); + qtest_clock_step(d.qts, ticks * TCO_TICK_NSEC * 2); =20 val =3D qpci_io_readw(d.dev, d.tco_io_bar, TCO2_STS); ret =3D val & (TCO_SECOND_TO_STS | TCO_BOOT_STS) ? 1 : 0; --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390397; cv=none; d=zoho.com; s=zohoarc; b=eFLdh6DcDK7xg6WZDM4bCrKZoms353r4rIRmQf7u1yBKZQgeVSJTjpi/MkGZK0do21nHnT0RRCibpslGOivntyWAlOFgPEkd3zI7Gnts8+gOgxsIKiaGII1RZW1ztpaQqm7KN8LtpwAsHIlM61h4Vh7aim2zd+1q7LQLve7gVPk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390397; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=piJiha7hnxpUKfRh0RQdzbg624MX2Cp39a7ow+ESxZ4=; b=Gx+vZtbsOIWsGBJiXfeuUCuNB0wWYXJFgQpSfYrx9/Q5T0rP0KFWvIzUzm/0hqJ75rDNl2o/1IGkFC/+Ny8FUXfZXIAvqT+nB2wnDHX5MlIrrnsGG2HGPuGqtYVPJa4vY/qgnlAfYwpd5b/O6yMIK1FPV/jt9lnCKKW2QhKkxqQ= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390397621122.77036354567497; Thu, 9 May 2019 01:26:37 -0700 (PDT) Received: from localhost ([127.0.0.1]:50336 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeNu-0000PU-L9 for importer@patchew.org; Thu, 09 May 2019 04:26:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHM-0001qX-EK for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHL-0000IJ-KT for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38206) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHL-0000I2-FW for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C931785539; Thu, 9 May 2019 08:19:46 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id B586F5B680; Thu, 9 May 2019 08:19:44 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:19 +0200 Message-Id: <20190509081930.19081-4-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 09 May 2019 08:19:46 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/14] tests/megasas: 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The test uses memwrite() and thus relies on global_qtest. Let's replace it with qtest_memwrite(), so that we are independent from global_qtest here. Message-Id: <20190409085245.31548-3-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/megasas-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/megasas-test.c b/tests/megasas-test.c index 33aa97042c..1111d331d3 100644 --- a/tests/megasas-test.c +++ b/tests/megasas-test.c @@ -66,7 +66,7 @@ static void megasas_pd_get_info_fuzz(void *obj, void *dat= a, QGuestAllocator *all context[7] =3D cpu_to_le32(0); =20 context_pa =3D guest_alloc(alloc, sizeof(context)); - memwrite(context_pa, context, sizeof(context)); + qtest_memwrite(dev->bus->qts, context_pa, context, sizeof(context)); qpci_io_writel(dev, bar, 0x40, context_pa); } =20 --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390124; cv=none; d=zoho.com; s=zohoarc; b=DkxBaLdxF8z0LUTxGlsjhqHZ6aoP3NnnL9Ra/jbCt7aH7cvZE3bTqtlXQkIQlCI/wNyIth03XrTeNn0OH34V7WVZGOJZLr2MQvroxOeXvUTPnSw0VN8BOSGUncOMjT8NW05tIiOvWh16AOHklaqj9MjsmJAbyMifLmpWwlMS0WM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390124; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=38W5D9dWs2sM99qmtJLzv/+Aok4BsFq9S3WGcJ1eEvg=; b=RZMkBv/FIQy8cl6dVw2oTY2vLImJZrGd6TgHi2pV+yFf07SSfgsy71o4hcPPF4LYHuNtHt975Vy0xAOb9PJfv+TBrIr3w6GYOJPNy5sGFpm1n/YofRJFaJRNjfuNFgyq+v1W4ISXbDmQQzUEsy+h1UIhprFgqH9IW+M++OFcGpg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390124575278.65457679714973; Thu, 9 May 2019 01:22:04 -0700 (PDT) Received: from localhost ([127.0.0.1]:50263 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeJK-0004l4-HX for importer@patchew.org; Thu, 09 May 2019 04:21:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHN-0001tc-V1 for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHN-0000JE-1h for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60336) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHM-0000Id-SE for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:48 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D78FC0601F2; Thu, 9 May 2019 08:19:48 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 311D55B681; Thu, 9 May 2019 08:19:46 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:20 +0200 Message-Id: <20190509081930.19081-5-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 09 May 2019 08:19:48 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 04/14] tests/qmp-cmd-test: Use qtest_init() instead of qtest_start() 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" qtest_start() + qtest_end() should be avoided, since they use the global_qtest variable that we want to get rid of in the long run (since global_qtest can not be used in tests that have to track multiple QEMU states, like migration tests). Use qtest_init() and qtest_quit() instead. Message-Id: <20190409085245.31548-4-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/qmp-cmd-test.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/qmp-cmd-test.c b/tests/qmp-cmd-test.c index d12cac539c..9f5228cd99 100644 --- a/tests/qmp-cmd-test.c +++ b/tests/qmp-cmd-test.c @@ -61,10 +61,11 @@ static void test_query(const void *data) int expected_error_class =3D query_error_class(cmd); QDict *resp, *error; const char *error_class; + QTestState *qts; =20 - qtest_start(common_args); + qts =3D qtest_init(common_args); =20 - resp =3D qmp("{ 'execute': %s }", cmd); + resp =3D qtest_qmp(qts, "{ 'execute': %s }", cmd); error =3D qdict_get_qdict(resp, "error"); error_class =3D error ? qdict_get_str(error, "class") : NULL; =20 @@ -78,7 +79,7 @@ static void test_query(const void *data) } qobject_unref(resp); =20 - qtest_end(); + qtest_quit(qts); } =20 static bool query_is_blacklisted(const char *cmd) @@ -118,16 +119,18 @@ static void qmp_schema_init(QmpSchema *schema) QDict *resp; Visitor *qiv; SchemaInfoList *tail; + QTestState *qts; =20 - qtest_start(common_args); - resp =3D qmp("{ 'execute': 'query-qmp-schema' }"); + qts =3D qtest_init(common_args); + + resp =3D qtest_qmp(qts, "{ 'execute': 'query-qmp-schema' }"); =20 qiv =3D qobject_input_visitor_new(qdict_get(resp, "return")); visit_type_SchemaInfoList(qiv, NULL, &schema->list, &error_abort); visit_free(qiv); =20 qobject_unref(resp); - qtest_end(); + qtest_quit(qts); =20 schema->hash =3D g_hash_table_new(g_str_hash, g_str_equal); =20 --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390263; cv=none; d=zoho.com; s=zohoarc; b=Gzeg7h1ZbJK8PaqZLbaHZjpXvk6ApsHFa14arTBGgiw2JhkD7BnyGpN10pykolkeBYvVqHr2zUEiEoR076PuJPrHaRAgZ0apg7rG18btuNKyzNTmeEBQ5xOe3q6vmb88GQgKMDa3lx4QqIB0YmoYNqbNagTvicvl1azCjv43pqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390263; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=+e1ZyhbS01rdVuusL0KFNflabPrbEBfjRmXmQGVwyi4=; b=Xua4JuG+6bG1swGcIqAw3576rSsy03p47sD8D+ffHBjsLY6BW1exXUKLf60wmY/z324UnYfmgSuJna63vAgOwomtGKWtv4ktePex5uULRdCKGo2IBfmwDJzpGit3H6oq73eXCm9Wb43S4Bn5lL4otDZhd03M80laxPGt7keWFAY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390263543433.3185005846452; Thu, 9 May 2019 01:24:23 -0700 (PDT) Received: from localhost ([127.0.0.1]:50288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeLm-0006uN-Gn for importer@patchew.org; Thu, 09 May 2019 04:24:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHP-0001xo-DQ for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHO-0000Km-FW for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56952) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHO-0000JW-Aj for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A7E71308793F; Thu, 9 May 2019 08:19:49 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A9885B680; Thu, 9 May 2019 08:19:48 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:21 +0200 Message-Id: <20190509081930.19081-6-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Thu, 09 May 2019 08:19:49 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 05/14] tests/test-hmp: Use qtest_init() instead of qtest_start() 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" qtest_start() + qtest_end() should be avoided, since they use the global_qtest variable that we want to get rid of in the long run Use qtest_init() and qtest_quit() instead. Reviewed-by: Dr. David Alan Gilbert Message-Id: <20190409085245.31548-5-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/test-hmp.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/test-hmp.c b/tests/test-hmp.c index e344947f7c..5029c4d2c9 100644 --- a/tests/test-hmp.c +++ b/tests/test-hmp.c @@ -73,13 +73,13 @@ static const char *hmp_cmds[] =3D { }; =20 /* Run through the list of pre-defined commands */ -static void test_commands(void) +static void test_commands(QTestState *qts) { char *response; int i; =20 for (i =3D 0; hmp_cmds[i] !=3D NULL; i++) { - response =3D hmp("%s", hmp_cmds[i]); + response =3D qtest_hmp(qts, "%s", hmp_cmds[i]); if (verbose) { fprintf(stderr, "\texecute HMP command: %s\n" @@ -92,11 +92,11 @@ static void test_commands(void) } =20 /* Run through all info commands and call them blindly (without arguments)= */ -static void test_info_commands(void) +static void test_info_commands(QTestState *qts) { char *resp, *info, *info_buf, *endp; =20 - info_buf =3D info =3D hmp("help info"); + info_buf =3D info =3D qtest_hmp(qts, "help info"); =20 while (*info) { /* Extract the info command, ignore parameters and description */ @@ -108,7 +108,7 @@ static void test_info_commands(void) if (verbose) { fprintf(stderr, "\t%s\n", info); } - resp =3D hmp("%s", info); + resp =3D qtest_hmp(qts, "%s", info); g_free(resp); /* And move forward to the next line */ info =3D strchr(endp + 1, '\n'); @@ -125,14 +125,15 @@ static void test_machine(gconstpointer data) { const char *machine =3D data; char *args; + QTestState *qts; =20 args =3D g_strdup_printf("-S -M %s", machine); - qtest_start(args); + qts =3D qtest_init(args); =20 - test_info_commands(); - test_commands(); + test_info_commands(qts); + test_commands(qts); =20 - qtest_end(); + qtest_quit(qts); g_free(args); g_free((void *)data); } --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390414; cv=none; d=zoho.com; s=zohoarc; b=kvwJCp42MvXgbd7WovFf7uzLr4qicLH8pLSjUif4n/J9krvajLcnGXGZy3CV8Pac3qe2WUUC89tigioVFDmo9u4F6aUbgB/BNWhFgn345kJlGDMdr3ZGienkrogDPRLfBrCgfWSljHH93RR7ll9s4XkJV1LeGj+pFioaoW9CbcQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390414; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=QCTd5IlRbegXBHvr12LXcqL/9VvW+uqQmNMIgl1ugb4=; b=dH513a1DdqqcutUUSjhT5gaw+UdIq7z9WeeChTyCmFhkFXO0dFH1RELt/BCz6RcePn+WfO/qcKw/ZfJMkmAgqabt18BzRoMGqUTHEzUDTt3y+bROp15UKb0BVMiJOuKzWj3hD8dJu95Hk1pv1yUKzC5+jj98bS1Kpyfd/6PhaF8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390414783216.7774589688081; Thu, 9 May 2019 01:26:54 -0700 (PDT) Received: from localhost ([127.0.0.1]:50338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeO8-0000aK-Kb for importer@patchew.org; Thu, 09 May 2019 04:26:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHS-00023b-Tg for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHQ-0000N2-61 for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58738) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHP-0000Mi-UK for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:52 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 478CE309B166; Thu, 9 May 2019 08:19:51 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10ABB5B680; Thu, 9 May 2019 08:19:49 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:22 +0200 Message-Id: <20190509081930.19081-7-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 09 May 2019 08:19:51 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 06/14] tests/ide-test: 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Pass around the QTestState, so we do not need the problematic global_qtest variable (which causes trouble for tests that have multiple test states) here anymore. Message-Id: <20190409085245.31548-6-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/ide-test.c | 284 ++++++++++++++++++++++++++--------------------- 1 file changed, 159 insertions(+), 125 deletions(-) diff --git a/tests/ide-test.c b/tests/ide-test.c index d863a99f7f..0277e7d5a9 100644 --- a/tests/ide-test.c +++ b/tests/ide-test.c @@ -36,7 +36,7 @@ #include "hw/pci/pci_regs.h" =20 /* TODO actually test the results and get rid of this */ -#define qmp_discard_response(...) qobject_unref(qmp(__VA_ARGS__)) +#define qmp_discard_response(q, ...) qobject_unref(qtest_qmp(q, __VA_ARGS_= _)) =20 #define TEST_IMAGE_SIZE 64 * 1024 * 1024 =20 @@ -125,38 +125,38 @@ static QGuestAllocator guest_malloc; static char tmp_path[] =3D "/tmp/qtest.XXXXXX"; static char debug_path[] =3D "/tmp/qtest-blkdebug.XXXXXX"; =20 -static void ide_test_start(const char *cmdline_fmt, ...) +static QTestState *ide_test_start(const char *cmdline_fmt, ...) { + QTestState *qts; va_list ap; - char *cmdline; =20 va_start(ap, cmdline_fmt); - cmdline =3D g_strdup_vprintf(cmdline_fmt, ap); + qts =3D qtest_vinitf(cmdline_fmt, ap); va_end(ap); =20 - qtest_start(cmdline); - pc_alloc_init(&guest_malloc, global_qtest, 0); + pc_alloc_init(&guest_malloc, qts, 0); =20 - g_free(cmdline); + return qts; } =20 -static void ide_test_quit(void) +static void ide_test_quit(QTestState *qts) { if (pcibus) { qpci_free_pc(pcibus); pcibus =3D NULL; } alloc_destroy(&guest_malloc); - qtest_end(); + qtest_quit(qts); } =20 -static QPCIDevice *get_pci_device(QPCIBar *bmdma_bar, QPCIBar *ide_bar) +static QPCIDevice *get_pci_device(QTestState *qts, QPCIBar *bmdma_bar, + QPCIBar *ide_bar) { QPCIDevice *dev; uint16_t vendor_id, device_id; =20 if (!pcibus) { - pcibus =3D qpci_new_pc(global_qtest, NULL); + pcibus =3D qpci_new_pc(qts, NULL); } =20 /* Find PCI device and verify it's the right one */ @@ -198,8 +198,8 @@ static uint64_t trim_range_le(uint64_t sector, uint16_t= count) return cpu_to_le64(((uint64_t)count << 48) + sector); } =20 -static int send_dma_request(int cmd, uint64_t sector, int nb_sectors, - PrdtEntry *prdt, int prdt_entries, +static int send_dma_request(QTestState *qts, int cmd, uint64_t sector, + int nb_sectors, PrdtEntry *prdt, int prdt_entr= ies, void(*post_exec)(QPCIDevice *dev, QPCIBar ide_= bar, uint64_t sector, int nb_secto= rs)) { @@ -211,7 +211,7 @@ static int send_dma_request(int cmd, uint64_t sector, i= nt nb_sectors, uint8_t status; int flags; =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 flags =3D cmd & ~0xff; cmd &=3D 0xff; @@ -246,7 +246,7 @@ static int send_dma_request(int cmd, uint64_t sector, i= nt nb_sectors, /* Setup PRDT */ len =3D sizeof(*prdt) * prdt_entries; guest_prdt =3D guest_alloc(&guest_malloc, len); - memwrite(guest_prdt, prdt, len); + qtest_memwrite(qts, guest_prdt, prdt, len); qpci_io_writel(dev, bmdma_bar, bmreg_prdt, guest_prdt); =20 /* ATA DMA command */ @@ -283,14 +283,15 @@ static int send_dma_request(int cmd, uint64_t sector,= int nb_sectors, status =3D qpci_io_readb(dev, bmdma_bar, bmreg_status); } while ((status & (BM_STS_ACTIVE | BM_STS_INTR)) =3D=3D BM_STS_ACTIVE= ); =20 - g_assert_cmpint(get_irq(IDE_PRIMARY_IRQ), =3D=3D, !!(status & BM_STS_I= NTR)); + g_assert_cmpint(qtest_get_irq(qts, IDE_PRIMARY_IRQ), =3D=3D, + !!(status & BM_STS_INTR)); =20 /* Check IDE status code */ assert_bit_set(qpci_io_readb(dev, ide_bar, reg_status), DRDY); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), BSY | DRQ); =20 /* Reading the status register clears the IRQ */ - g_assert(!get_irq(IDE_PRIMARY_IRQ)); + g_assert(!qtest_get_irq(qts, IDE_PRIMARY_IRQ)); =20 /* Stop DMA transfer if still active */ if (status & BM_STS_ACTIVE) { @@ -302,42 +303,61 @@ static int send_dma_request(int cmd, uint64_t sector,= int nb_sectors, return status; } =20 +static QTestState *test_bmdma_setup(void) +{ + QTestState *qts; + + qts =3D ide_test_start( + "-drive file=3D%s,if=3Dide,cache=3Dwriteback,format=3Draw " + "-global ide-hd.serial=3D%s -global ide-hd.ver=3D%s", + tmp_path, "testdisk", "version"); + qtest_irq_intercept_in(qts, "ioapic"); + + return qts; +} + +static void test_bmdma_teardown(QTestState *qts) +{ + ide_test_quit(qts); +} + static void test_bmdma_simple_rw(void) { + QTestState *qts; QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; uint8_t status; uint8_t *buf; uint8_t *cmpbuf; size_t len =3D 512; - uintptr_t guest_buf =3D guest_alloc(&guest_malloc, len); + uintptr_t guest_buf; + PrdtEntry prdt[1]; =20 - PrdtEntry prdt[] =3D { - { - .addr =3D cpu_to_le32(guest_buf), - .size =3D cpu_to_le32(len | PRDT_EOT), - }, - }; + qts =3D test_bmdma_setup(); + + guest_buf =3D guest_alloc(&guest_malloc, len); + prdt[0].addr =3D cpu_to_le32(guest_buf); + prdt[0].size =3D cpu_to_le32(len | PRDT_EOT); =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 buf =3D g_malloc(len); cmpbuf =3D g_malloc(len); =20 /* Write 0x55 pattern to sector 0 */ memset(buf, 0x55, len); - memwrite(guest_buf, buf, len); + qtest_memwrite(qts, guest_buf, buf, len); =20 - status =3D send_dma_request(CMD_WRITE_DMA, 0, 1, prdt, + status =3D send_dma_request(qts, CMD_WRITE_DMA, 0, 1, prdt, ARRAY_SIZE(prdt), NULL); g_assert_cmphex(status, =3D=3D, BM_STS_INTR); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); =20 /* Write 0xaa pattern to sector 1 */ memset(buf, 0xaa, len); - memwrite(guest_buf, buf, len); + qtest_memwrite(qts, guest_buf, buf, len); =20 - status =3D send_dma_request(CMD_WRITE_DMA, 1, 1, prdt, + status =3D send_dma_request(qts, CMD_WRITE_DMA, 1, 1, prdt, ARRAY_SIZE(prdt), NULL); g_assert_cmphex(status, =3D=3D, BM_STS_INTR); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); @@ -345,31 +365,35 @@ static void test_bmdma_simple_rw(void) /* Read and verify 0x55 pattern in sector 0 */ memset(cmpbuf, 0x55, len); =20 - status =3D send_dma_request(CMD_READ_DMA, 0, 1, prdt, ARRAY_SIZE(prdt)= , NULL); + status =3D send_dma_request(qts, CMD_READ_DMA, 0, 1, prdt, ARRAY_SIZE(= prdt), + NULL); g_assert_cmphex(status, =3D=3D, BM_STS_INTR); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); =20 - memread(guest_buf, buf, len); + qtest_memread(qts, guest_buf, buf, len); g_assert(memcmp(buf, cmpbuf, len) =3D=3D 0); =20 /* Read and verify 0xaa pattern in sector 1 */ memset(cmpbuf, 0xaa, len); =20 - status =3D send_dma_request(CMD_READ_DMA, 1, 1, prdt, ARRAY_SIZE(prdt)= , NULL); + status =3D send_dma_request(qts, CMD_READ_DMA, 1, 1, prdt, ARRAY_SIZE(= prdt), + NULL); g_assert_cmphex(status, =3D=3D, BM_STS_INTR); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); =20 - memread(guest_buf, buf, len); + qtest_memread(qts, guest_buf, buf, len); g_assert(memcmp(buf, cmpbuf, len) =3D=3D 0); =20 - free_pci_device(dev); g_free(buf); g_free(cmpbuf); + + test_bmdma_teardown(qts); } =20 static void test_bmdma_trim(void) { + QTestState *qts; QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; uint8_t status; @@ -380,16 +404,16 @@ static void test_bmdma_trim(void) const uint64_t bad_range =3D trim_range_le(TEST_IMAGE_SIZE / 512 - 1, = 2); size_t len =3D 512; uint8_t *buf; - uintptr_t guest_buf =3D guest_alloc(&guest_malloc, len); + uintptr_t guest_buf; + PrdtEntry prdt[1]; =20 - PrdtEntry prdt[] =3D { - { - .addr =3D cpu_to_le32(guest_buf), - .size =3D cpu_to_le32(len | PRDT_EOT), - }, - }; + qts =3D test_bmdma_setup(); + + guest_buf =3D guest_alloc(&guest_malloc, len); + prdt[0].addr =3D cpu_to_le32(guest_buf), + prdt[0].size =3D cpu_to_le32(len | PRDT_EOT), =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 buf =3D g_malloc(len); =20 @@ -397,9 +421,9 @@ static void test_bmdma_trim(void) *((uint64_t *)buf) =3D trim_range[0]; *((uint64_t *)buf + 1) =3D trim_range[1]; =20 - memwrite(guest_buf, buf, 2 * sizeof(uint64_t)); + qtest_memwrite(qts, guest_buf, buf, 2 * sizeof(uint64_t)); =20 - status =3D send_dma_request(CMD_DSM, 0, 1, prdt, + status =3D send_dma_request(qts, CMD_DSM, 0, 1, prdt, ARRAY_SIZE(prdt), NULL); g_assert_cmphex(status, =3D=3D, BM_STS_INTR); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); @@ -408,9 +432,9 @@ static void test_bmdma_trim(void) *((uint64_t *)buf) =3D trim_range[2]; *((uint64_t *)buf + 1) =3D bad_range; =20 - memwrite(guest_buf, buf, 2 * sizeof(uint64_t)); + qtest_memwrite(qts, guest_buf, buf, 2 * sizeof(uint64_t)); =20 - status =3D send_dma_request(CMD_DSM, 0, 1, prdt, + status =3D send_dma_request(qts, CMD_DSM, 0, 1, prdt, ARRAY_SIZE(prdt), NULL); g_assert_cmphex(status, =3D=3D, BM_STS_INTR); assert_bit_set(qpci_io_readb(dev, ide_bar, reg_status), ERR); @@ -418,10 +442,12 @@ static void test_bmdma_trim(void) =20 free_pci_device(dev); g_free(buf); + test_bmdma_teardown(qts); } =20 static void test_bmdma_short_prdt(void) { + QTestState *qts; QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; uint8_t status; @@ -433,24 +459,28 @@ static void test_bmdma_short_prdt(void) }, }; =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + qts =3D test_bmdma_setup(); + + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 /* Normal request */ - status =3D send_dma_request(CMD_READ_DMA, 0, 1, + status =3D send_dma_request(qts, CMD_READ_DMA, 0, 1, prdt, ARRAY_SIZE(prdt), NULL); g_assert_cmphex(status, =3D=3D, 0); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); =20 /* Abort the request before it completes */ - status =3D send_dma_request(CMD_READ_DMA | CMDF_ABORT, 0, 1, + status =3D send_dma_request(qts, CMD_READ_DMA | CMDF_ABORT, 0, 1, prdt, ARRAY_SIZE(prdt), NULL); g_assert_cmphex(status, =3D=3D, 0); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); free_pci_device(dev); + test_bmdma_teardown(qts); } =20 static void test_bmdma_one_sector_short_prdt(void) { + QTestState *qts; QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; uint8_t status; @@ -463,24 +493,28 @@ static void test_bmdma_one_sector_short_prdt(void) }, }; =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + qts =3D test_bmdma_setup(); + + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 /* Normal request */ - status =3D send_dma_request(CMD_READ_DMA, 0, 2, + status =3D send_dma_request(qts, CMD_READ_DMA, 0, 2, prdt, ARRAY_SIZE(prdt), NULL); g_assert_cmphex(status, =3D=3D, 0); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); =20 /* Abort the request before it completes */ - status =3D send_dma_request(CMD_READ_DMA | CMDF_ABORT, 0, 2, + status =3D send_dma_request(qts, CMD_READ_DMA | CMDF_ABORT, 0, 2, prdt, ARRAY_SIZE(prdt), NULL); g_assert_cmphex(status, =3D=3D, 0); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); free_pci_device(dev); + test_bmdma_teardown(qts); } =20 static void test_bmdma_long_prdt(void) { + QTestState *qts; QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; uint8_t status; @@ -492,29 +526,35 @@ static void test_bmdma_long_prdt(void) }, }; =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + qts =3D test_bmdma_setup(); + + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 /* Normal request */ - status =3D send_dma_request(CMD_READ_DMA, 0, 1, + status =3D send_dma_request(qts, CMD_READ_DMA, 0, 1, prdt, ARRAY_SIZE(prdt), NULL); g_assert_cmphex(status, =3D=3D, BM_STS_ACTIVE | BM_STS_INTR); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); =20 /* Abort the request before it completes */ - status =3D send_dma_request(CMD_READ_DMA | CMDF_ABORT, 0, 1, + status =3D send_dma_request(qts, CMD_READ_DMA | CMDF_ABORT, 0, 1, prdt, ARRAY_SIZE(prdt), NULL); g_assert_cmphex(status, =3D=3D, BM_STS_INTR); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); free_pci_device(dev); + test_bmdma_teardown(qts); } =20 static void test_bmdma_no_busmaster(void) { + QTestState *qts; QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; uint8_t status; =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + qts =3D test_bmdma_setup(); + + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 /* No PRDT_EOT, each entry addr 0/size 64k, and in theory qemu shouldn= 't be * able to access it anyway because the Bus Master bit in the PCI comm= and @@ -522,7 +562,7 @@ static void test_bmdma_no_busmaster(void) * good at confusing and occasionally crashing qemu. */ PrdtEntry prdt[4096] =3D { }; =20 - status =3D send_dma_request(CMD_READ_DMA | CMDF_NO_BM, 0, 512, + status =3D send_dma_request(qts, CMD_READ_DMA | CMDF_NO_BM, 0, 512, prdt, ARRAY_SIZE(prdt), NULL); =20 /* Not entirely clear what the expected result is, but this is what we= get @@ -530,20 +570,7 @@ static void test_bmdma_no_busmaster(void) g_assert_cmphex(status, =3D=3D, BM_STS_ACTIVE | BM_STS_INTR); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); free_pci_device(dev); -} - -static void test_bmdma_setup(void) -{ - ide_test_start( - "-drive file=3D%s,if=3Dide,cache=3Dwriteback,format=3Draw " - "-global ide-hd.serial=3D%s -global ide-hd.ver=3D%s", - tmp_path, "testdisk", "version"); - qtest_irq_intercept_in(global_qtest, "ioapic"); -} - -static void test_bmdma_teardown(void) -{ - ide_test_quit(); + test_bmdma_teardown(qts); } =20 static void string_cpu_to_be16(uint16_t *s, size_t bytes) @@ -559,6 +586,7 @@ static void string_cpu_to_be16(uint16_t *s, size_t byte= s) =20 static void test_identify(void) { + QTestState *qts; QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; uint8_t data; @@ -566,12 +594,12 @@ static void test_identify(void) int i; int ret; =20 - ide_test_start( + qts =3D ide_test_start( "-drive file=3D%s,if=3Dide,cache=3Dwriteback,format=3Draw " "-global ide-hd.serial=3D%s -global ide-hd.ver=3D%s", tmp_path, "testdisk", "version"); =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 /* IDENTIFY command on device 0*/ qpci_io_writeb(dev, ide_bar, reg_device, 0); @@ -605,7 +633,7 @@ static void test_identify(void) /* Write cache enabled bit */ assert_bit_set(buf[85], 0x20); =20 - ide_test_quit(); + ide_test_quit(qts); free_pci_device(dev); } =20 @@ -613,7 +641,7 @@ static void test_identify(void) * Write sector 1 with random data to make IDE storage dirty * Needed for flush tests so that flushes actually go though the block lay= er */ -static void make_dirty(uint8_t device) +static void make_dirty(QTestState *qts, uint8_t device) { QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; @@ -622,7 +650,7 @@ static void make_dirty(uint8_t device) uintptr_t guest_buf; void* buf; =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 guest_buf =3D guest_alloc(&guest_malloc, len); buf =3D g_malloc(len); @@ -630,7 +658,7 @@ static void make_dirty(uint8_t device) g_assert(guest_buf); g_assert(buf); =20 - memwrite(guest_buf, buf, len); + qtest_memwrite(qts, guest_buf, buf, len); =20 PrdtEntry prdt[] =3D { { @@ -639,7 +667,7 @@ static void make_dirty(uint8_t device) }, }; =20 - status =3D send_dma_request(CMD_WRITE_DMA, 1, 1, prdt, + status =3D send_dma_request(qts, CMD_WRITE_DMA, 1, 1, prdt, ARRAY_SIZE(prdt), NULL); g_assert_cmphex(status, =3D=3D, BM_STS_INTR); assert_bit_clear(qpci_io_readb(dev, ide_bar, reg_status), DF | ERR); @@ -650,23 +678,24 @@ static void make_dirty(uint8_t device) =20 static void test_flush(void) { + QTestState *qts; QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; uint8_t data; =20 - ide_test_start( + qts =3D ide_test_start( "-drive file=3Dblkdebug::%s,if=3Dide,cache=3Dwriteback,format=3Dra= w", tmp_path); =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 - qtest_irq_intercept_in(global_qtest, "ioapic"); + qtest_irq_intercept_in(qts, "ioapic"); =20 /* Dirty media so that CMD_FLUSH_CACHE will actually go to disk */ - make_dirty(0); + make_dirty(qts, 0); =20 /* Delay the completion of the flush request until we explicitly do it= */ - g_free(hmp("qemu-io ide0-hd0 \"break flush_to_os A\"")); + g_free(qtest_hmp(qts, "qemu-io ide0-hd0 \"break flush_to_os A\"")); =20 /* FLUSH CACHE command on device 0*/ qpci_io_writeb(dev, ide_bar, reg_device, 0); @@ -678,7 +707,7 @@ static void test_flush(void) assert_bit_clear(data, DF | ERR | DRQ); =20 /* Complete the command */ - g_free(hmp("qemu-io ide0-hd0 \"resume A\"")); + g_free(qtest_hmp(qts, "qemu-io ide0-hd0 \"resume A\"")); =20 /* Check registers */ data =3D qpci_io_readb(dev, ide_bar, reg_device); @@ -691,29 +720,30 @@ static void test_flush(void) assert_bit_set(data, DRDY); assert_bit_clear(data, BSY | DF | ERR | DRQ); =20 - ide_test_quit(); + ide_test_quit(qts); free_pci_device(dev); } =20 static void test_retry_flush(const char *machine) { + QTestState *qts; QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; uint8_t data; =20 prepare_blkdebug_script(debug_path, "flush_to_disk"); =20 - ide_test_start( + qts =3D ide_test_start( "-drive file=3Dblkdebug:%s:%s,if=3Dide,cache=3Dwriteback,format=3D= raw," "rerror=3Dstop,werror=3Dstop", debug_path, tmp_path); =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 - qtest_irq_intercept_in(global_qtest, "ioapic"); + qtest_irq_intercept_in(qts, "ioapic"); =20 /* Dirty media so that CMD_FLUSH_CACHE will actually go to disk */ - make_dirty(0); + make_dirty(qts, 0); =20 /* FLUSH CACHE command on device 0*/ qpci_io_writeb(dev, ide_bar, reg_device, 0); @@ -724,10 +754,10 @@ static void test_retry_flush(const char *machine) assert_bit_set(data, BSY | DRDY); assert_bit_clear(data, DF | ERR | DRQ); =20 - qmp_eventwait("STOP"); + qtest_qmp_eventwait(qts, "STOP"); =20 /* Complete the command */ - qmp_discard_response("{'execute':'cont' }"); + qmp_discard_response(qts, "{'execute':'cont' }"); =20 /* Check registers */ data =3D qpci_io_readb(dev, ide_bar, reg_device); @@ -740,18 +770,19 @@ static void test_retry_flush(const char *machine) assert_bit_set(data, DRDY); assert_bit_clear(data, BSY | DF | ERR | DRQ); =20 - ide_test_quit(); + ide_test_quit(qts); free_pci_device(dev); } =20 static void test_flush_nodev(void) { + QTestState *qts; QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; =20 - ide_test_start(""); + qts =3D ide_test_start(""); =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 /* FLUSH CACHE command on device 0*/ qpci_io_writeb(dev, ide_bar, reg_device, 0); @@ -760,16 +791,17 @@ static void test_flush_nodev(void) /* Just testing that qemu doesn't crash... */ =20 free_pci_device(dev); - ide_test_quit(); + ide_test_quit(qts); } =20 static void test_flush_empty_drive(void) { + QTestState *qts; QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; =20 - ide_test_start("-device ide-cd,bus=3Dide.0"); - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + qts =3D ide_test_start("-device ide-cd,bus=3Dide.0"); + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 /* FLUSH CACHE command on device 0 */ qpci_io_writeb(dev, ide_bar, reg_device, 0); @@ -778,7 +810,7 @@ static void test_flush_empty_drive(void) /* Just testing that qemu doesn't crash... */ =20 free_pci_device(dev); - ide_test_quit(); + ide_test_quit(qts); } =20 static void test_pci_retry_flush(void) @@ -823,21 +855,21 @@ static void send_scsi_cdb_read10(QPCIDevice *dev, QPC= IBar ide_bar, } } =20 -static void nsleep(int64_t nsecs) +static void nsleep(QTestState *qts, int64_t nsecs) { const struct timespec val =3D { .tv_nsec =3D nsecs }; nanosleep(&val, NULL); - clock_set(nsecs); + qtest_clock_set(qts, nsecs); } =20 -static uint8_t ide_wait_clear(uint8_t flag) +static uint8_t ide_wait_clear(QTestState *qts, uint8_t flag) { QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; uint8_t data; time_t st; =20 - dev =3D get_pci_device(&bmdma_bar, &ide_bar); + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); =20 /* Wait with a 5 second timeout */ time(&st); @@ -850,26 +882,26 @@ static uint8_t ide_wait_clear(uint8_t flag) if (difftime(time(NULL), st) > 5.0) { break; } - nsleep(400); + nsleep(qts, 400); } g_assert_not_reached(); } =20 -static void ide_wait_intr(int irq) +static void ide_wait_intr(QTestState *qts, int irq) { time_t st; bool intr; =20 time(&st); while (true) { - intr =3D get_irq(irq); + intr =3D qtest_get_irq(qts, irq); if (intr) { return; } if (difftime(time(NULL), st) > 5.0) { break; } - nsleep(400); + nsleep(qts, 400); } =20 g_assert_not_reached(); @@ -877,6 +909,7 @@ static void ide_wait_intr(int irq) =20 static void cdrom_pio_impl(int nblocks) { + QTestState *qts; QPCIDevice *dev; QPCIBar bmdma_bar, ide_bar; FILE *fh; @@ -897,10 +930,11 @@ static void cdrom_pio_impl(int nblocks) g_assert_cmpint(ret, =3D=3D, patt_blocks); fclose(fh); =20 - ide_test_start("-drive if=3Dnone,file=3D%s,media=3Dcdrom,format=3Draw,= id=3Dsr0,index=3D0 " - "-device ide-cd,drive=3Dsr0,bus=3Dide.0", tmp_path); - dev =3D get_pci_device(&bmdma_bar, &ide_bar); - qtest_irq_intercept_in(global_qtest, "ioapic"); + qts =3D ide_test_start( + "-drive if=3Dnone,file=3D%s,media=3Dcdrom,format=3Draw,id=3Dsr= 0,index=3D0 " + "-device ide-cd,drive=3Dsr0,bus=3Dide.0", tmp_path); + dev =3D get_pci_device(qts, &bmdma_bar, &ide_bar); + qtest_irq_intercept_in(qts, "ioapic"); =20 /* PACKET command on device 0 */ qpci_io_writeb(dev, ide_bar, reg_device, 0); @@ -908,8 +942,8 @@ static void cdrom_pio_impl(int nblocks) qpci_io_writeb(dev, ide_bar, reg_lba_high, (BYTE_COUNT_LIMIT >> 8 & 0x= FF)); qpci_io_writeb(dev, ide_bar, reg_command, CMD_PACKET); /* HP0: Check_Status_A State */ - nsleep(400); - data =3D ide_wait_clear(BSY); + nsleep(qts, 400); + data =3D ide_wait_clear(qts, BSY); /* HP1: Send_Packet State */ assert_bit_set(data, DRQ | DRDY); assert_bit_clear(data, ERR | DF | BSY); @@ -930,10 +964,10 @@ static void cdrom_pio_impl(int nblocks) size_t rem =3D (rxsize / 2) - offset; =20 /* HP3: INTRQ_Wait */ - ide_wait_intr(IDE_PRIMARY_IRQ); + ide_wait_intr(qts, IDE_PRIMARY_IRQ); =20 /* HP2: Check_Status_B (and clear IRQ) */ - data =3D ide_wait_clear(BSY); + data =3D ide_wait_clear(qts, BSY); assert_bit_set(data, DRQ | DRDY); assert_bit_clear(data, ERR | DF | BSY); =20 @@ -945,17 +979,17 @@ static void cdrom_pio_impl(int nblocks) } =20 /* Check for final completion IRQ */ - ide_wait_intr(IDE_PRIMARY_IRQ); + ide_wait_intr(qts, IDE_PRIMARY_IRQ); =20 /* Sanity check final state */ - data =3D ide_wait_clear(DRQ); + data =3D ide_wait_clear(qts, DRQ); assert_bit_set(data, DRDY); assert_bit_clear(data, DRQ | ERR | DF | BSY); =20 g_assert_cmpint(memcmp(pattern, rx, rxsize), =3D=3D, 0); g_free(pattern); g_free(rx); - test_bmdma_teardown(); + test_bmdma_teardown(qts); free_pci_device(dev); } =20 @@ -973,6 +1007,7 @@ static void test_cdrom_pio_large(void) =20 static void test_cdrom_dma(void) { + QTestState *qts; static const size_t len =3D ATAPI_BLOCK_SIZE; size_t ret; char *pattern =3D g_malloc(ATAPI_BLOCK_SIZE * 16); @@ -981,9 +1016,10 @@ static void test_cdrom_dma(void) PrdtEntry prdt[1]; FILE *fh; =20 - ide_test_start("-drive if=3Dnone,file=3D%s,media=3Dcdrom,format=3Draw,= id=3Dsr0,index=3D0 " - "-device ide-cd,drive=3Dsr0,bus=3Dide.0", tmp_path); - qtest_irq_intercept_in(global_qtest, "ioapic"); + qts =3D ide_test_start( + "-drive if=3Dnone,file=3D%s,media=3Dcdrom,format=3Draw,id=3Dsr= 0,index=3D0 " + "-device ide-cd,drive=3Dsr0,bus=3Dide.0", tmp_path); + qtest_irq_intercept_in(qts, "ioapic"); =20 guest_buf =3D guest_alloc(&guest_malloc, len); prdt[0].addr =3D cpu_to_le32(guest_buf); @@ -995,15 +1031,15 @@ static void test_cdrom_dma(void) g_assert_cmpint(ret, =3D=3D, 16); fclose(fh); =20 - send_dma_request(CMD_PACKET, 0, 1, prdt, 1, send_scsi_cdb_read10); + send_dma_request(qts, CMD_PACKET, 0, 1, prdt, 1, send_scsi_cdb_read10); =20 /* Read back data from guest memory into local qtest memory */ - memread(guest_buf, rx, len); + qtest_memread(qts, guest_buf, rx, len); g_assert_cmpint(memcmp(pattern, rx, len), =3D=3D, 0); =20 g_free(pattern); g_free(rx); - test_bmdma_teardown(); + test_bmdma_teardown(qts); } =20 int main(int argc, char **argv) @@ -1028,7 +1064,6 @@ int main(int argc, char **argv) =20 qtest_add_func("/ide/identify", test_identify); =20 - qtest_add_func("/ide/bmdma/setup", test_bmdma_setup); qtest_add_func("/ide/bmdma/simple_rw", test_bmdma_simple_rw); qtest_add_func("/ide/bmdma/trim", test_bmdma_trim); qtest_add_func("/ide/bmdma/short_prdt", test_bmdma_short_prdt); @@ -1036,7 +1071,6 @@ int main(int argc, char **argv) test_bmdma_one_sector_short_prdt); qtest_add_func("/ide/bmdma/long_prdt", test_bmdma_long_prdt); qtest_add_func("/ide/bmdma/no_busmaster", test_bmdma_no_busmaster); - qtest_add_func("/ide/bmdma/teardown", test_bmdma_teardown); =20 qtest_add_func("/ide/flush", test_flush); qtest_add_func("/ide/flush/nodev", test_flush_nodev); --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390126; cv=none; d=zoho.com; s=zohoarc; b=P2eci+Q8wKWTxQGH0xG9kjkh9kuPqC5AQLBkMIyjbQsDZk6c3bt71HlsWRA/yqyoxqOCiGMOIXuXqPrMA0BAgCvgJQDXg2ib5GQw+H4Zcyk16k5Yi2ALmJzzKZF22TtW+eHe+aeOpH1cu2cW7P4RISNkJxWMBXfsXIJTTcu2w9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390126; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=tT9a2gkgmZ/nUwVv9r3BjxY5inaD7Ofl77Q+JlfZsds=; b=HZMGlzMAV+4Zpg22P2CIMzOA4M4h2AjAnjUfeLPns0gF3eZ4QKMQtClMs1Clx3ulCgxGMkYkycdibqFOnKKpLKZed6TBCHDaLKk7FlvLynt7Ge5X5Wx0+sgebrfU214SHidBvP675t3N8DB8O/LNFe+jujamLfQ/ZJ4ow9Dfck4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390126041524.5852059792799; Thu, 9 May 2019 01:22:06 -0700 (PDT) Received: from localhost ([127.0.0.1]:50265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeJP-0004vg-Ru for importer@patchew.org; Thu, 09 May 2019 04:21:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHS-000239-C7 for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHR-0000Ng-H0 for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45190) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHR-0000NT-AQ for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:53 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A1D8C81F25; Thu, 9 May 2019 08:19:52 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 92DA55B680; Thu, 9 May 2019 08:19:51 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:23 +0200 Message-Id: <20190509081930.19081-8-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 09 May 2019 08:19:52 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 07/14] tests/tpm-tests: Use g_test_skip() to mark skipped tests 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Since we do not use gtester anymore (which had a bug here), we can now use g_test_skip() to mark skipped tests. Reviewed-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Berger Message-Id: <20190424094557.28404-1-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/tpm-tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tpm-tests.c b/tests/tpm-tests.c index 582ec0cfd4..e640777aa9 100644 --- a/tests/tpm-tests.c +++ b/tests/tpm-tests.c @@ -22,7 +22,7 @@ static bool tpm_test_swtpm_skip(void) { if (!tpm_util_swtpm_has_tpm2()) { - g_test_message("swtpm not in PATH or missing --tpm2 support"); + g_test_skip("swtpm not in PATH or missing --tpm2 support"); return true; } =20 --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390270; cv=none; d=zoho.com; s=zohoarc; b=WyPxLRAaOQJv9uDTw8NQNEeRW5zELWHSC6Edoxvwd1eQ4+A/Ovz5Xs0pj05H3vToMFF+e8aKd7QqyuSvP2R7qAZf9Aq2nNK3RJ7VkC57fl9u6ZtrQ0QUjlNLdrgmqLehvBcT2nWFlsRUQ+C5U279/sDeYUZP7FLuhB97RWsSMgA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390270; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=DflWen0K0iZFv3G0cKFgen26JFJ2+YQtTvVMere1quc=; b=ICFXnLxriCbk0Urn6numVTOQF2tAj7s2NU8x9JqJcy5ouAHBpMG6lhsutGlics4Ez+1ZQUd7MvL/ia/H94w/QL3/PiKoIsOc/i5XX3xNP6RGwalfsBAgj2qNIH7pf5nAMdVS2MjMWWkYEYJ6nw4g/FWrSDtMoL9z/bcqxHQnugc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390270077768.2358604278888; Thu, 9 May 2019 01:24:30 -0700 (PDT) Received: from localhost ([127.0.0.1]:50290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeLr-0006y4-1j for importer@patchew.org; Thu, 09 May 2019 04:24:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44707) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHT-00024T-Qr for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHS-0000OF-Ta for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39858) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHS-0000Ns-OE for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 16EAD3058951; Thu, 9 May 2019 08:19:54 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 08C145B680; Thu, 9 May 2019 08:19:52 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:24 +0200 Message-Id: <20190509081930.19081-9-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 09 May 2019 08:19:54 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 08/14] tests/Makefile: Remove unused test-obj-y variable 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" I recently noticed that test-obj-y contains a file called tests/check-block-qtest.o which simply does not belong to any .c file and thus wondered why this is not causing any trouble. It is only used to add -Itests to the command line (which refers to the build directory). However, it is not needed because "-iquote $(@D)" already sets this up in rules.mak. Thus we can simply remove this variable. Reviewed-by: Markus Armbruster Message-Id: <20190508075527.32164-1-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/Makefile.include | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index af88ab6f8b..60de085ee1 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -482,25 +482,6 @@ GENERATED_FILES +=3D tests/test-qapi-types.h \ tests/test-qapi-events-sub-sub-module.h \ tests/test-qapi-introspect.h =20 -test-obj-y =3D tests/check-qnum.o tests/check-qstring.o tests/check-qdict.= o \ - tests/check-qlist.o tests/check-qnull.o tests/check-qobject.o \ - tests/check-qjson.o tests/check-qlit.o \ - tests/check-block-qtest.o \ - tests/test-coroutine.o tests/test-string-output-visitor.o \ - tests/test-string-input-visitor.o tests/test-qobject-output-visitor.o \ - tests/test-clone-visitor.o \ - tests/test-qobject-input-visitor.o \ - tests/test-qmp-cmds.o tests/test-visitor-serialization.o \ - tests/test-x86-cpuid.o tests/test-mul64.o tests/test-int128.o \ - tests/test-opts-visitor.o tests/test-qmp-event.o \ - tests/rcutorture.o tests/test-rcu-list.o \ - tests/test-rcu-simpleq.o \ - tests/test-rcu-tailq.o \ - tests/test-qdist.o tests/test-shift128.o \ - tests/test-qht.o tests/qht-bench.o tests/test-qht-par.o \ - tests/atomic_add-bench.o tests/atomic64-bench.o - -$(test-obj-y): QEMU_INCLUDES +=3D -Itests QEMU_CFLAGS +=3D -I$(SRC_PATH)/tests =20 =20 --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390553; cv=none; d=zoho.com; s=zohoarc; b=hyYliEkYuatigenV1TpD+Ry8uw5+dM8BTbygM5tuhbOfwoHsy2yQVX7Rk/3Bgxi0Sgo6w9RhUHHJnHqU5JwNF61ti7RkQxfWr6xtcHOotyw4dkQ7XVGPCYZ25EVS6mnUnpG3AU4brHe0RjqNHP+yxFBnNPWrvA34fdqmV7qjmqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390553; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=9l73FrPuLeJPkyAx9GknMocDOFxDn6XDZt0rmR4Qq8M=; b=T26olSTXWV3UOxrq1Sx+ex4pz11zLqPwahdHwg9+mAaSw+P3mtBna28EIPCOU/ixgjysVek+fdFZ3ec5BYwMhe57fHCv5YDn9jalc8+D1uWiQhWIdyPQY/ZBQ3/AbDRy3beV/oKzhZ1pPlGXd9xU0cbLHgLbOOfGHYEiHcC2jko= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390553139864.4230526197956; Thu, 9 May 2019 01:29:13 -0700 (PDT) Received: from localhost ([127.0.0.1]:50358 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeQQ-00030A-3u for importer@patchew.org; Thu, 09 May 2019 04:29:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHV-000281-Kd for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHU-0000P2-DH for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60293) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHU-0000Ok-68 for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:56 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8369B3066497; Thu, 9 May 2019 08:19:55 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 72D555B680; Thu, 9 May 2019 08:19:54 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:25 +0200 Message-Id: <20190509081930.19081-10-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 09 May 2019 08:19:55 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 09/14] tests/drive_del-test: Use qtest_init() instead of qtest_start() 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" qtest_start() + qtest_end() should be avoided, since they use the global_qtest variable that we want to get rid of in the long run Use qtest_init() and qtest_quit() instead. Reviewed-by: Eric Blake Message-Id: <20190508142153.21555-1-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/drive_del-test.c | 63 +++++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/tests/drive_del-test.c b/tests/drive_del-test.c index 2f9474e03c..b56b223fc2 100644 --- a/tests/drive_del-test.c +++ b/tests/drive_del-test.c @@ -16,32 +16,32 @@ #include "qapi/qmp/qdict.h" =20 /* TODO actually test the results and get rid of this */ -#define qmp_discard_response(...) qobject_unref(qmp(__VA_ARGS__)) +#define qmp_discard_response(q, ...) qobject_unref(qtest_qmp(q, __VA_ARGS_= _)) =20 -static void drive_add(void) +static void drive_add(QTestState *qts) { - char *resp =3D hmp("drive_add 0 if=3Dnone,id=3Ddrive0"); + char *resp =3D qtest_hmp(qts, "drive_add 0 if=3Dnone,id=3Ddrive0"); =20 g_assert_cmpstr(resp, =3D=3D, "OK\r\n"); g_free(resp); } =20 -static void drive_del(void) +static void drive_del(QTestState *qts) { - char *resp =3D hmp("drive_del drive0"); + char *resp =3D qtest_hmp(qts, "drive_del drive0"); =20 g_assert_cmpstr(resp, =3D=3D, ""); g_free(resp); } =20 -static void device_del(void) +static void device_del(QTestState *qts) { QDict *response; =20 /* Complication: ignore DEVICE_DELETED event */ - qmp_discard_response("{'execute': 'device_del'," + qmp_discard_response(qts, "{'execute': 'device_del'," " 'arguments': { 'id': 'dev0' } }"); - response =3D qmp_receive(); + response =3D qtest_qmp_receive(qts); g_assert(response); g_assert(qdict_haskey(response, "return")); qobject_unref(response); @@ -49,18 +49,20 @@ static void device_del(void) =20 static void test_drive_without_dev(void) { + QTestState *qts; + /* Start with an empty drive */ - qtest_start("-drive if=3Dnone,id=3Ddrive0"); + qts =3D qtest_init("-drive if=3Dnone,id=3Ddrive0"); =20 /* Delete the drive */ - drive_del(); + drive_del(qts); =20 /* Ensure re-adding the drive works - there should be no duplicate ID = error * because the old drive must be gone. */ - drive_add(); + drive_add(qts); =20 - qtest_end(); + qtest_quit(qts); } =20 /* @@ -85,54 +87,53 @@ static void test_after_failed_device_add(void) { char driver[32]; QDict *response; + QTestState *qts; =20 snprintf(driver, sizeof(driver), "virtio-blk-%s", qvirtio_get_dev_type()); =20 - qtest_start("-drive if=3Dnone,id=3Ddrive0"); + qts =3D qtest_init("-drive if=3Dnone,id=3Ddrive0"); =20 /* Make device_add fail. If this leaks the virtio-blk device then a * reference to drive0 will also be held (via qdev properties). */ - response =3D qmp("{'execute': 'device_add'," - " 'arguments': {" - " 'driver': %s," - " 'drive': 'drive0'" - "}}", driver); + response =3D qtest_qmp(qts, "{'execute': 'device_add'," + " 'arguments': {" + " 'driver': %s," + " 'drive': 'drive0'" + "}}", driver); g_assert(response); qmp_assert_error_class(response, "GenericError"); =20 /* Delete the drive */ - drive_del(); + drive_del(qts); =20 /* Try to re-add the drive. This fails with duplicate IDs if a leaked * virtio-blk device exists that holds a reference to the old drive0. */ - drive_add(); + drive_add(qts); =20 - qtest_end(); + qtest_quit(qts); } =20 static void test_drive_del_device_del(void) { - char *args; + QTestState *qts; =20 /* Start with a drive used by a device that unplugs instantaneously */ - args =3D g_strdup_printf("-drive if=3Dnone,id=3Ddrive0,file=3Dnull-co:= //,format=3Draw" - " -device virtio-scsi-%s" - " -device scsi-hd,drive=3Ddrive0,id=3Ddev0", - qvirtio_get_dev_type()); - qtest_start(args); + qts =3D qtest_initf("-drive if=3Dnone,id=3Ddrive0,file=3Dnull-co://,fo= rmat=3Draw" + " -device virtio-scsi-%s" + " -device scsi-hd,drive=3Ddrive0,id=3Ddev0", + qvirtio_get_dev_type()); =20 /* * Delete the drive, and then the device * Doing it in this order takes notoriously tricky special paths */ - drive_del(); - device_del(); + drive_del(qts); + device_del(qts); =20 - qtest_end(); - g_free(args); + qtest_quit(qts); } =20 int main(int argc, char **argv) --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390533; cv=none; d=zoho.com; s=zohoarc; b=nnBhuhyeaYiqR1xnClTEakxvaXacqOK/wl0xYVU8AJZDP7u4ODwDn+lMLZcxFk5ox2O3UY4EmKA0wjCWU+9rlGhxaXWJLaychYNRmJ9BjkzsRqtlWW7Cm5a3TnQTjpvcoXMd/pVO7SaztJJTcqhLYM5tRdVBxI9/mB1FAeA1dpQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390533; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=84CvJWC5Mj3LwCEClgIlH8wyjyWyiPL4yN4HI/YMV/I=; b=iaYIEEj+ev3uSA66K0UfPY7HF1rNDFJIV7N18pi7OGoIIh7UNlQRzXUniuqsK0jUgeDQOIW0TzEU1oceD905SDf7xWjV0J16a0+LO9UM5VIu9KPcXxxhc2AYew9TSW0Ggl7/F6XXW+iwOMQ6ZfbaOFt24xolAAk8kFhBYHwd9XA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390533741607.4788592993586; Thu, 9 May 2019 01:28:53 -0700 (PDT) Received: from localhost ([127.0.0.1]:50356 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeQ8-0002kM-MB for importer@patchew.org; Thu, 09 May 2019 04:28:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHX-0002BB-5r for qemu-devel@nongnu.org; Thu, 09 May 2019 04:20:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHV-0000Qy-RS for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53754) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHV-0000Qf-Jn for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:57 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EBED1308425B; Thu, 9 May 2019 08:19:56 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEC9A5B680; Thu, 9 May 2019 08:19:55 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:26 +0200 Message-Id: <20190509081930.19081-11-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 09 May 2019 08:19:56 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/14] tests: qpci_unplug_acpi_device_test() should not rely on 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" libqos functions should not use functions that require global_qtest to be set, since such library functions could also be used by tests that deal with multiple test states. Add a parameter to this function to explicitly specify the test state. Reviewed-by: Eric Blake Message-Id: <20190508143209.24350-1-thuth@redhat.com> Signed-off-by: Thomas Huth --- tests/e1000e-test.c | 4 +++- tests/ivshmem-test.c | 9 ++++++--- tests/libqos/pci-pc.c | 10 +++++----- tests/libqos/pci.h | 2 +- tests/virtio-blk-test.c | 3 ++- tests/virtio-net-test.c | 4 +++- tests/virtio-rng-test.c | 5 ++++- 7 files changed, 24 insertions(+), 13 deletions(-) diff --git a/tests/e1000e-test.c b/tests/e1000e-test.c index 77ba8095bb..6a946c0484 100644 --- a/tests/e1000e-test.c +++ b/tests/e1000e-test.c @@ -231,8 +231,10 @@ static void test_e1000e_multiple_transfers(void *obj, = void *data, =20 static void test_e1000e_hotplug(void *obj, void *data, QGuestAllocator * a= lloc) { + QTestState *qts =3D global_qtest; /* TODO: get rid of global_qtest he= re */ + qtest_qmp_device_add("e1000e", "e1000e_net", "{'addr': '0x06'}"); - qpci_unplug_acpi_device_test("e1000e_net", 0x06); + qpci_unplug_acpi_device_test(qts, "e1000e_net", 0x06); } =20 static void data_test_clear(void *sockets) diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c index 227561fbca..a467b8c03d 100644 --- a/tests/ivshmem-test.c +++ b/tests/ivshmem-test.c @@ -383,18 +383,21 @@ static void test_ivshmem_server(void) =20 static void test_ivshmem_hotplug(void) { + QTestState *qts; const char *arch =3D qtest_get_arch(); =20 - qtest_start("-object memory-backend-ram,size=3D1M,id=3Dmb1"); + qts =3D qtest_init("-object memory-backend-ram,size=3D1M,id=3Dmb1"); =20 + global_qtest =3D qts; /* TODO: Get rid of global_qtest here */ qtest_qmp_device_add("ivshmem-plain", "iv1", "{'addr': %s, 'memdev': 'mb1'}", stringify(PCI_SLOT_HP)); if (strcmp(arch, "ppc64") !=3D 0) { - qpci_unplug_acpi_device_test("iv1", PCI_SLOT_HP); + qpci_unplug_acpi_device_test(qts, "iv1", PCI_SLOT_HP); } =20 - qtest_end(); + qtest_quit(qts); + global_qtest =3D NULL; } =20 static void test_ivshmem_memdev(void) diff --git a/tests/libqos/pci-pc.c b/tests/libqos/pci-pc.c index 407d8aff78..634fedd049 100644 --- a/tests/libqos/pci-pc.c +++ b/tests/libqos/pci-pc.c @@ -176,19 +176,19 @@ void qpci_free_pc(QPCIBus *bus) g_free(s); } =20 -void qpci_unplug_acpi_device_test(const char *id, uint8_t slot) +void qpci_unplug_acpi_device_test(QTestState *qts, const char *id, uint8_t= slot) { QDict *response; =20 - response =3D qmp("{'execute': 'device_del', 'arguments': {'id': %s}}", - id); + response =3D qtest_qmp(qts, "{'execute': 'device_del'," + " 'arguments': {'id': %s}}", id); g_assert(response); g_assert(!qdict_haskey(response, "error")); qobject_unref(response); =20 - outb(ACPI_PCIHP_ADDR + PCI_EJ_BASE, 1 << slot); + qtest_outb(qts, ACPI_PCIHP_ADDR + PCI_EJ_BASE, 1 << slot); =20 - qmp_eventwait("DEVICE_DELETED"); + qtest_qmp_eventwait(qts, "DEVICE_DELETED"); } =20 static void qpci_pc_register_nodes(void) diff --git a/tests/libqos/pci.h b/tests/libqos/pci.h index 8e1d292a7d..a5389a5845 100644 --- a/tests/libqos/pci.h +++ b/tests/libqos/pci.h @@ -123,7 +123,7 @@ QPCIBar qpci_iomap(QPCIDevice *dev, int barno, uint64_t= *sizeptr); void qpci_iounmap(QPCIDevice *dev, QPCIBar addr); QPCIBar qpci_legacy_iomap(QPCIDevice *dev, uint16_t addr); =20 -void qpci_unplug_acpi_device_test(const char *id, uint8_t slot); +void qpci_unplug_acpi_device_test(QTestState *qs, const char *id, uint8_t = slot); =20 void add_qpci_address(QOSGraphEdgeOptions *opts, QPCIAddress *addr); #endif diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c index b65365934b..fe1168a90a 100644 --- a/tests/virtio-blk-test.c +++ b/tests/virtio-blk-test.c @@ -679,6 +679,7 @@ static void pci_hotplug(void *obj, void *data, QGuestAl= locator *t_alloc) { QVirtioPCIDevice *dev1 =3D obj; QVirtioPCIDevice *dev; + QTestState *qts =3D dev1->pdev->bus->qts; =20 /* plug secondary disk */ qtest_qmp_device_add("virtio-blk-pci", "drv1", @@ -693,7 +694,7 @@ static void pci_hotplug(void *obj, void *data, QGuestAl= locator *t_alloc) qos_object_destroy((QOSGraphObject *)dev); =20 /* unplug secondary disk */ - qpci_unplug_acpi_device_test("drv1", PCI_SLOT_HP); + qpci_unplug_acpi_device_test(qts, "drv1", PCI_SLOT_HP); } =20 /* diff --git a/tests/virtio-net-test.c b/tests/virtio-net-test.c index 0d956f36fe..163126cf07 100644 --- a/tests/virtio-net-test.c +++ b/tests/virtio-net-test.c @@ -162,13 +162,15 @@ static void stop_cont_test(void *obj, void *data, QGu= estAllocator *t_alloc) =20 static void hotplug(void *obj, void *data, QGuestAllocator *t_alloc) { + QVirtioPCIDevice *dev =3D obj; + QTestState *qts =3D dev->pdev->bus->qts; const char *arch =3D qtest_get_arch(); =20 qtest_qmp_device_add("virtio-net-pci", "net1", "{'addr': %s}", stringify(PCI_SLOT_HP)); =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { - qpci_unplug_acpi_device_test("net1", PCI_SLOT_HP); + qpci_unplug_acpi_device_test(qts, "net1", PCI_SLOT_HP); } } =20 diff --git a/tests/virtio-rng-test.c b/tests/virtio-rng-test.c index 5309c7c8ab..fcb22481bd 100644 --- a/tests/virtio-rng-test.c +++ b/tests/virtio-rng-test.c @@ -16,13 +16,16 @@ =20 static void rng_hotplug(void *obj, void *data, QGuestAllocator *alloc) { + QVirtioPCIDevice *dev =3D obj; + QTestState *qts =3D dev->pdev->bus->qts; + const char *arch =3D qtest_get_arch(); =20 qtest_qmp_device_add("virtio-rng-pci", "rng1", "{'addr': %s}", stringify(PCI_SLOT_HP)); =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { - qpci_unplug_acpi_device_test("rng1", PCI_SLOT_HP); + qpci_unplug_acpi_device_test(qts, "rng1", PCI_SLOT_HP); } } =20 --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390820; cv=none; d=zoho.com; s=zohoarc; b=oQ9p0Fl9lkRwEWc3G9gWK2toXGcCO3jb2NEK8+MFwQBMVRiUi/XNqlaWa/iGHCH3s59JpDqNZx3+5XwwlO8bdb0ZYDTeoxtiHCKBs0n/9d8F4uRAqQxocPmqFeGjAHsf64x//BVcW55VQ82xn/SOaBto0wCtlHCJxRnVKggXQSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390820; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=0Nj8Q6h/Z1XZM/EbULY9nZCDMTEDDqXOC3R6sPEseTY=; b=WozsPyovfPO4hS2hs2LbqTOWQtMEnUazxcDyoERonqnOCax6s8a7OCh+1L+iB49C5VeXE6UdSCmULO2OgfMCWbzzSgcvWHlTZlVTO+Do48hiabYtotxK+uY3OmMO8B1LwucYaNbDao2JsszKQ74Lx06NMkPZHzC5womW/3KB4ds= ARC-Authentication-Results: i=1; mx.zoho.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390820184225.54858993503137; Thu, 9 May 2019 01:33:40 -0700 (PDT) Received: from localhost ([127.0.0.1]:50504 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeUY-0006jA-NY for importer@patchew.org; Thu, 09 May 2019 04:33:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHY-0002CX-Br for qemu-devel@nongnu.org; Thu, 09 May 2019 04:20:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHX-0000Rj-6s for qemu-devel@nongnu.org; Thu, 09 May 2019 04:20:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58780) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHX-0000RI-0L for qemu-devel@nongnu.org; Thu, 09 May 2019 04:19:59 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 56654309B170; Thu, 9 May 2019 08:19:58 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 48D0E5B680; Thu, 9 May 2019 08:19:57 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:27 +0200 Message-Id: <20190509081930.19081-12-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Thu, 09 May 2019 08:19:58 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 11/14] hw/i2c/smbus_ich9: Fix the confusing contributions-after-2012 statement 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The license information in this file is rather confusing. The text declares LGPL first, but then says that contributions after Jan 2012 are licensed under the GPL instead. How should the average user who just downloaded the release tarball know which part is now GPL and which is LGPL? Also, as far as I can see, the file has been added to QEMU *after* January in 2012, so the whole file should be GPL by default instead. Furthermore, looking at the text of the LGPL (see COPYING.LIB in the top directory), the license clearly states in section "3." that one should rather replace the license information in such a case instead. Thus let's clean up the confusing statements and use the proper GPL text only. Message-Id: <1549471435-21887-1-git-send-email-thuth@redhat.com> Signed-off-by: Thomas Huth --- hw/i2c/smbus_ich9.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index 7b24be8256..251d3d142f 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -6,23 +6,18 @@ * VA Linux Systems Japan K.K. * Copyright (C) 2012 Jason Baron * - * This is based on acpi.c, but heavily rewritten. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, + * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see - * - * Contributions after 2012-01-13 are licensed under the terms of the - * GNU GPL, version 2 or (at your option) any later version. + * General Public License for more details. * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see */ #include "qemu/osdep.h" #include "hw/hw.h" --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390691; cv=none; d=zoho.com; s=zohoarc; b=hag7iLN94EYzA7w+w0XJy3IyDD5Xgo270sm9p30CHH0AMd0K+ghsf72BKT9inZs1ZLSL+Bw02Wjj241jFcUs0jWKWtzvXKjrZUnheopda0gpSgqRtIjaL0WCTsmzk8fGUE6xk6+ipjx62AT6rfA4jFCluh7LgtoAm1r5xfgApAA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390691; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=4ASBrEajiqERuSrXQwwOReTYYS5lK81AbRJ+5MSpf+s=; b=FE8174/bwM2fwdN1WYcp2SFELWBR6w/alxXZ2MrZouxrlqGrtDBfpbuO6Js4hUb4vbq5L/zDNaSQ6XoDYApnKMqeqc81eGxKm3vCi5UsJjVtoRbEsetJnoZMXtKdu+iJay8mrTaGXNE41c3smrw6VZ5vJE0Cq+sqYzRaXD5OS20= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390691390626.1204443113653; Thu, 9 May 2019 01:31:31 -0700 (PDT) Received: from localhost ([127.0.0.1]:50427 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeSg-0005SM-CB for importer@patchew.org; Thu, 09 May 2019 04:31:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44771) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHa-0002DI-GA for qemu-devel@nongnu.org; Thu, 09 May 2019 04:20:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHY-0000Sf-S1 for qemu-devel@nongnu.org; Thu, 09 May 2019 04:20:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27068) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHY-0000SH-FW for qemu-devel@nongnu.org; Thu, 09 May 2019 04:20:00 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CABB730026B2; Thu, 9 May 2019 08:19:59 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC0AB5B680; Thu, 9 May 2019 08:19:58 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:28 +0200 Message-Id: <20190509081930.19081-13-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Thu, 09 May 2019 08:19:59 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 12/14] target/openrisc: Fix LGPL information in the file headers 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" It's either "GNU *Library* General Public License version 2" or "GNU Lesser General Public License version *2.1*", but there was no "version 2.0" of the "Lesser" license. So assume that version 2.1 is meant here. Acked-by: Stafford Horne Message-Id: <1550073577-4248-1-git-send-email-thuth@redhat.com> Signed-off-by: Thomas Huth --- hw/openrisc/cputimer.c | 2 +- hw/openrisc/openrisc_sim.c | 2 +- hw/openrisc/pic_cpu.c | 2 +- linux-user/openrisc/target_cpu.h | 2 +- linux-user/openrisc/target_structs.h | 2 +- target/openrisc/cpu.h | 2 +- target/openrisc/exception.c | 2 +- target/openrisc/exception_helper.c | 2 +- target/openrisc/fpu_helper.c | 2 +- target/openrisc/insns.decode | 2 +- target/openrisc/interrupt.c | 2 +- target/openrisc/machine.c | 2 +- target/openrisc/mmu.c | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/hw/openrisc/cputimer.c b/hw/openrisc/cputimer.c index 850f88761c..fe95efc41c 100644 --- a/hw/openrisc/cputimer.c +++ b/hw/openrisc/cputimer.c @@ -7,7 +7,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c index 7d3b734d24..0a906d815e 100644 --- a/hw/openrisc/openrisc_sim.c +++ b/hw/openrisc/openrisc_sim.c @@ -7,7 +7,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/hw/openrisc/pic_cpu.c b/hw/openrisc/pic_cpu.c index 569b443f59..2f53cfc82e 100644 --- a/hw/openrisc/pic_cpu.c +++ b/hw/openrisc/pic_cpu.c @@ -7,7 +7,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/linux-user/openrisc/target_cpu.h b/linux-user/openrisc/target_= cpu.h index d1ea4506e2..32ff135089 100644 --- a/linux-user/openrisc/target_cpu.h +++ b/linux-user/openrisc/target_cpu.h @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/linux-user/openrisc/target_structs.h b/linux-user/openrisc/tar= get_structs.h index afbb7ad108..e98e2bc799 100644 --- a/linux-user/openrisc/target_structs.h +++ b/linux-user/openrisc/target_structs.h @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/openrisc/cpu.h b/target/openrisc/cpu.h index a50861955a..88a8c70092 100644 --- a/target/openrisc/cpu.h +++ b/target/openrisc/cpu.h @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/openrisc/exception.c b/target/openrisc/exception.c index 49470be051..28c1fce523 100644 --- a/target/openrisc/exception.c +++ b/target/openrisc/exception.c @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/openrisc/exception_helper.c b/target/openrisc/exception= _helper.c index 6073a5b21c..0797cc9d38 100644 --- a/target/openrisc/exception_helper.c +++ b/target/openrisc/exception_helper.c @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/openrisc/fpu_helper.c b/target/openrisc/fpu_helper.c index 265ce13337..b9d2ebbb8c 100644 --- a/target/openrisc/fpu_helper.c +++ b/target/openrisc/fpu_helper.c @@ -7,7 +7,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/openrisc/insns.decode b/target/openrisc/insns.decode index dad68c8422..7df81c1f22 100644 --- a/target/openrisc/insns.decode +++ b/target/openrisc/insns.decode @@ -6,7 +6,7 @@ # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. +# version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/openrisc/interrupt.c b/target/openrisc/interrupt.c index bbae956361..ee280df895 100644 --- a/target/openrisc/interrupt.c +++ b/target/openrisc/interrupt.c @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/openrisc/machine.c b/target/openrisc/machine.c index 5d822f7ab1..c9e084814c 100644 --- a/target/openrisc/machine.c +++ b/target/openrisc/machine.c @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/openrisc/mmu.c b/target/openrisc/mmu.c index e7d5219e11..5dec68dcff 100644 --- a/target/openrisc/mmu.c +++ b/target/openrisc/mmu.c @@ -7,7 +7,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390464; cv=none; d=zoho.com; s=zohoarc; b=EKu6BmZYgWAH0RcjM/kXfnUcKTjOT+Uz3WM/AUYJSK0vPA8FhGfzyu7JTaZPDnTYuHOiL5dtmm+zpjKH5eF9SfeBvq9SlB/E2XDKfG/QsNLBV19B28DSO2ZrBAceUMuOp4C7QoCTD44pasZA2BgGOORm1wHf6lXBBrS3F9IM2iY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390464; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=fDeTodX8LWx2p8vyIb2ATTXKmP7Nqo8oiiIOaZ2C54o=; b=DQREg/UMIgY5n/PN+fnqF3Yzz9y45ri5CcN78hi1j6Tok2Qsk85iJYIAKS7uwXEpY+N0j6n6DzdypDY/Ibg8HIDJlxxEKUqh5wF2m5u9DryvfpTah98OhT56JeniP/oT+0nEWHF4bhVDpX1uSgo4AtpMzE44X7RXIpjlZ5nlyg8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390464450699.6880351585629; Thu, 9 May 2019 01:27:44 -0700 (PDT) Received: from localhost ([127.0.0.1]:50340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeOv-0001lV-FR for importer@patchew.org; Thu, 09 May 2019 04:27:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44783) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHb-0002DM-DP for qemu-devel@nongnu.org; Thu, 09 May 2019 04:20:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHa-0000TW-3y for qemu-devel@nongnu.org; Thu, 09 May 2019 04:20:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38266) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHZ-0000T9-Si for qemu-devel@nongnu.org; Thu, 09 May 2019 04:20:02 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3672285539; Thu, 9 May 2019 08:20:01 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 321F25B680; Thu, 9 May 2019 08:19:59 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:29 +0200 Message-Id: <20190509081930.19081-14-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 09 May 2019 08:20:01 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 13/14] target/sh4: Fix LGPL information in the file headers 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" It's either "GNU *Library* General Public License version 2" or "GNU Lesser General Public License version *2.1*", but there was no "version 2.0" of the "Lesser" license. So assume that version 2.1 is meant here. Message-Id: <1550073530-4138-1-git-send-email-thuth@redhat.com> Signed-off-by: Thomas Huth --- linux-user/sh4/target_cpu.h | 2 +- linux-user/sh4/target_structs.h | 2 +- target/sh4/cpu.h | 2 +- target/sh4/gdbstub.c | 2 +- target/sh4/helper.c | 2 +- target/sh4/op_helper.c | 2 +- target/sh4/translate.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/linux-user/sh4/target_cpu.h b/linux-user/sh4/target_cpu.h index 1a647ddb98..b0be9a2c1b 100644 --- a/linux-user/sh4/target_cpu.h +++ b/linux-user/sh4/target_cpu.h @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/linux-user/sh4/target_structs.h b/linux-user/sh4/target_struct= s.h index 3e832bf69a..00ac39478b 100644 --- a/linux-user/sh4/target_structs.h +++ b/linux-user/sh4/target_structs.h @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h index 84b08ff640..1be36fe875 100644 --- a/target/sh4/cpu.h +++ b/target/sh4/cpu.h @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/sh4/gdbstub.c b/target/sh4/gdbstub.c index 13bea00d7d..54568e96f9 100644 --- a/target/sh4/gdbstub.c +++ b/target/sh4/gdbstub.c @@ -7,7 +7,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/sh4/helper.c b/target/sh4/helper.c index 2ff0cf4060..fa51269fb1 100644 --- a/target/sh4/helper.c +++ b/target/sh4/helper.c @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/sh4/op_helper.c b/target/sh4/op_helper.c index 4f825bae5a..28027f9e0b 100644 --- a/target/sh4/op_helper.c +++ b/target/sh4/op_helper.c @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/target/sh4/translate.c b/target/sh4/translate.c index cdf0888490..5a7d8c4535 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -6,7 +6,7 @@ * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. + * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of --=20 2.21.0 From nobody Fri May 3 10:25:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1557390677; cv=none; d=zoho.com; s=zohoarc; b=HJZpbtDog/8Vf2cOFDVFijrBTjSQscnfPdiAGumAbwKvzEiaKajVKz/J+dmmmIdvqDjLxZP6U4KdULYxrJnjLT1+blOWR39flFvKSQx5Vl/xROA9/MJrKKwpO9VsIg469NTxDB3jednCGxQwstFLwmCyrWAp/2xL43PtMgGJmWo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557390677; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=Yv59naOmMdyYwDMjdzGqOCuM3U9LlBXVS5ZEYbHxSrw=; b=FEiH6xpEF1N4ClhYWRfF9E7sOEVYe3YnjBA/NvtZcx2g49qZ/igtXA7uHCDg/H9eyPiitooHJQ4i3wMO8X/4dGsB/OxOfQXczp3j11nxNfakEYEY7cXM7NwWjEvfaaxvp8wSSTHFVOBA7d0V88wHnfOnkBTSNiXmHV1izjFwAEM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557390677986995.3514625089946; Thu, 9 May 2019 01:31:17 -0700 (PDT) Received: from localhost ([127.0.0.1]:50409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeSQ-0004aI-0T for importer@patchew.org; Thu, 09 May 2019 04:31:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hOeHc-0002Dp-K5 for qemu-devel@nongnu.org; Thu, 09 May 2019 04:20:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hOeHb-0000V2-JC for qemu-devel@nongnu.org; Thu, 09 May 2019 04:20:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36566) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hOeHb-0000U1-EA for qemu-devel@nongnu.org; Thu, 09 May 2019 04:20:03 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B7CF5307EA8F; Thu, 9 May 2019 08:20:02 +0000 (UTC) Received: from thuth.com (ovpn-116-115.ams2.redhat.com [10.36.116.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C22B5B680; Thu, 9 May 2019 08:20:01 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 9 May 2019 10:19:30 +0200 Message-Id: <20190509081930.19081-15-thuth@redhat.com> In-Reply-To: <20190509081930.19081-1-thuth@redhat.com> References: <20190509081930.19081-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 09 May 2019 08:20:02 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 14/14] include/exec/poison: Mark TARGET_FMT_lu as poisoned, too 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: ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" We already poison TARGET_FMT_lx and TARGET_FMT_ld, but apparently forgot to poison TARGET_FMT_lu, too. Do it now. Reviewed-by: Richard Henderson Message-Id: <20190508150608.3311-1-thuth@redhat.com> Signed-off-by: Thomas Huth --- include/exec/poison.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/exec/poison.h b/include/exec/poison.h index 1a7a57baae..b862320fa6 100644 --- a/include/exec/poison.h +++ b/include/exec/poison.h @@ -44,6 +44,7 @@ #pragma GCC poison TARGET_LONG_BITS #pragma GCC poison TARGET_FMT_lx #pragma GCC poison TARGET_FMT_ld +#pragma GCC poison TARGET_FMT_lu =20 #pragma GCC poison TARGET_PAGE_SIZE #pragma GCC poison TARGET_PAGE_MASK --=20 2.21.0