From nobody Wed Nov 5 10:35:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534419624104473.88969451902904; Thu, 16 Aug 2018 04:40:24 -0700 (PDT) Received: from localhost ([::1]:54932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGda-0005Bt-Uh for importer@patchew.org; Thu, 16 Aug 2018 07:40:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGZU-0001BD-F9 for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqGZS-0003LX-QW for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:08 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42208 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fqGZS-0003LI-L0 for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:06 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4DE32401EF13; Thu, 16 Aug 2018 11:36:06 +0000 (UTC) Received: from thuth.com (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6A202156716; Thu, 16 Aug 2018 11:36:04 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Thu, 16 Aug 2018 13:35:51 +0200 Message-Id: <1534419358-10932-2-git-send-email-thuth@redhat.com> In-Reply-To: <1534419358-10932-1-git-send-email-thuth@redhat.com> References: <1534419358-10932-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 16 Aug 2018 11:36:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 16 Aug 2018 11:36:06 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 1/8] tests/migration-test: Silence the kvm_hv message by default X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , "Michael S. Tsirkin" , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When running "make check" on a non-POWER host, the output is quite distorted like this: [...] GTESTER check-qtest-nios2 GTESTER check-qtest-or1k GTESTER check-qtest-ppc64 Skipping test: kvm_hv not available Skipping test: kvm_hv not available Ski= pping test: kvm_hv not available Skipping test: kvm_hv not available GTES= TER check-qtest-ppcemb GTESTER check-qtest-ppc GTESTER check-qtest-riscv32 GTESTER check-qtest-riscv64 [...] Move the check to the beginning of the main function instead, so that we do not have to test the condition again and again for each test, and better use g_test_message() instead of g_print() here, like it is also done in ufd_version_check() already. Reviewed-by: Markus Armbruster Signed-off-by: Thomas Huth Reviewed-by: Juan Quintela --- tests/migration-test.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/migration-test.c b/tests/migration-test.c index eb58d0a..0e687b7 100644 --- a/tests/migration-test.c +++ b/tests/migration-test.c @@ -438,15 +438,6 @@ static int test_migrate_start(QTestState **from, QTest= State **to, " -incoming %s", accel, tmpfs, bootpath, uri); } else if (strcmp(arch, "ppc64") =3D=3D 0) { - - /* On ppc64, the test only works with kvm-hv, but not with kvm-pr - * and TCG is touchy due to race conditions on dirty bits - * (especially on PPC for some reason) - */ - if (access("/sys/module/kvm_hv", F_OK)) { - g_print("Skipping test: kvm_hv not available "); - return -1; - } cmd_src =3D g_strdup_printf("-machine accel=3D%s -m 256M" " -name source,debug-threads=3Don" " -serial file:%s/src_serial" @@ -750,6 +741,17 @@ int main(int argc, char **argv) return 0; } =20 + /* + * On ppc64, the test only works with kvm-hv, but not with kvm-pr and = TCG + * is touchy due to race conditions on dirty bits (especially on PPC f= or + * some reason) + */ + if (g_str_equal(qtest_get_arch(), "ppc64") && + access("/sys/module/kvm_hv", F_OK)) { + g_test_message("Skipping test: kvm_hv not available"); + return 0; + } + tmpfs =3D mkdtemp(template); if (!tmpfs) { g_test_message("mkdtemp on path (%s): %s\n", template, strerror(er= rno)); --=20 1.8.3.1 From nobody Wed Nov 5 10:35:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 153441948570514.77734585329199; Thu, 16 Aug 2018 04:38:05 -0700 (PDT) Received: from localhost ([::1]:54924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGbJ-0002Kd-5d for importer@patchew.org; Thu, 16 Aug 2018 07:38:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGZV-0001BG-5K for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqGZU-0003MV-GV for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:09 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55742 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fqGZU-0003MB-9N for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:08 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F2C57402312B; Thu, 16 Aug 2018 11:36:07 +0000 (UTC) Received: from thuth.com (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 85C072156715; Thu, 16 Aug 2018 11:36:06 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Thu, 16 Aug 2018 13:35:52 +0200 Message-Id: <1534419358-10932-3-git-send-email-thuth@redhat.com> In-Reply-To: <1534419358-10932-1-git-send-email-thuth@redhat.com> References: <1534419358-10932-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 16 Aug 2018 11:36:08 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 16 Aug 2018 11:36:08 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 2/8] net: Silence 'has no peer' messages in testing mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , "Michael S. Tsirkin" , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" When running qtests with -nodefaults, we are not interested in these 'XYZ has no peer' messages. Signed-off-by: Thomas Huth --- vl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vl.c b/vl.c index 16b913f..7055df3 100644 --- a/vl.c +++ b/vl.c @@ -4559,11 +4559,10 @@ int main(int argc, char **argv, char **envp) * (2) CONFIG_SLIRP not set, in which case the implicit "-net nic" * sets up a nic that isn't connected to anything. */ - if (!default_net) { + if (!default_net && (!qtest_enabled() || has_defaults)) { net_check_clients(); } =20 - if (boot_once) { qemu_boot_set(boot_once, &error_fatal); qemu_register_reset(restore_boot_order, g_strdup(boot_order)); --=20 1.8.3.1 From nobody Wed Nov 5 10:35:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534419724724608.237980492785; Thu, 16 Aug 2018 04:42:04 -0700 (PDT) Received: from localhost ([::1]:54945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGfD-0007pQ-Kr for importer@patchew.org; Thu, 16 Aug 2018 07:42:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGZX-0001Bx-04 for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqGZW-0003Nc-5e for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:10 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34536 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fqGZV-0003NI-V9 for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:10 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A1E87F2B5B; Thu, 16 Aug 2018 11:36:09 +0000 (UTC) Received: from thuth.com (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 356862166BA0; Thu, 16 Aug 2018 11:36:08 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Thu, 16 Aug 2018 13:35:53 +0200 Message-Id: <1534419358-10932-4-git-send-email-thuth@redhat.com> In-Reply-To: <1534419358-10932-1-git-send-email-thuth@redhat.com> References: <1534419358-10932-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 16 Aug 2018 11:36:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 16 Aug 2018 11:36:09 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 3/8] hw/timer/mc146818rtc: White space clean-up X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , "Michael S. Tsirkin" , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" mc146818rtc.c still contains some TABs. Replace them with spaces. And while we're at it, also delete trailing whitespace in this file. Reviewed-by: Markus Armbruster Signed-off-by: Thomas Huth Reviewed-by: Juan Quintela --- hw/timer/mc146818rtc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 6f1f723..3a14075 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -120,7 +120,7 @@ static void rtc_coalesced_timer_update(RTCState *s) timer_del(s->coalesced_timer); } else { /* divide each RTC interval to 2 - 8 smaller intervals */ - int c =3D MIN(s->irq_coalesced, 7) + 1;=20 + int c =3D MIN(s->irq_coalesced, 7) + 1; int64_t next_clock =3D qemu_clock_get_ns(rtc_clock) + periodic_clock_to_ns(s->period / c); timer_mod(s->coalesced_timer, next_clock); @@ -485,7 +485,7 @@ static void cmos_ioport_write(void *opaque, hwaddr addr, s->cmos_data[s->cmos_index] =3D data; check_update_timer(s); break; - case RTC_IBM_PS2_CENTURY_BYTE: + case RTC_IBM_PS2_CENTURY_BYTE: s->cmos_index =3D RTC_CENTURY; /* fall through */ case RTC_CENTURY: @@ -713,7 +713,7 @@ static uint64_t cmos_ioport_read(void *opaque, hwaddr a= ddr, return 0xff; } else { switch(s->cmos_index) { - case RTC_IBM_PS2_CENTURY_BYTE: + case RTC_IBM_PS2_CENTURY_BYTE: s->cmos_index =3D RTC_CENTURY; /* fall through */ case RTC_CENTURY: @@ -915,7 +915,7 @@ static void rtc_reset(void *opaque) =20 if (s->lost_tick_policy =3D=3D LOST_TICK_POLICY_SLEW) { s->irq_coalesced =3D 0; - s->irq_reinject_on_ack_count =3D 0; =09 + s->irq_reinject_on_ack_count =3D 0; } } =20 --=20 1.8.3.1 From nobody Wed Nov 5 10:35:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534419492100732.1961016732245; Thu, 16 Aug 2018 04:38:12 -0700 (PDT) Received: from localhost ([::1]:54925 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGbS-0002RE-W3 for importer@patchew.org; Thu, 16 Aug 2018 07:38:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGZb-0001FX-L7 for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqGZX-0003OT-Ps for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:14 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42210 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fqGZX-0003O4-KZ for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:11 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 53469410BC18; Thu, 16 Aug 2018 11:36:11 +0000 (UTC) Received: from thuth.com (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id D92EF2156716; Thu, 16 Aug 2018 11:36:09 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Thu, 16 Aug 2018 13:35:54 +0200 Message-Id: <1534419358-10932-5-git-send-email-thuth@redhat.com> In-Reply-To: <1534419358-10932-1-git-send-email-thuth@redhat.com> References: <1534419358-10932-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 16 Aug 2018 11:36:11 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 16 Aug 2018 11:36:11 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 4/8] hw/timer/mc146818rtc: Fix introspection problem X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , "Michael S. Tsirkin" , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" There is currently a funny problem with the "mc146818rtc" device: 1) Start QEMU like this: qemu-system-ppc64 -M pseries -S 2) At the HMP monitor, enter "info qom-tree". Note that there is an entry for "/rtc (spapr-rtc)". 3) Introspect the mc146818rtc device like this: device_add mc146818rtc,help 4) Run "info qom-tree" again. The "/rtc" entry is gone now! The rtc_finalize() function of the mc146818rtc device has two bugs: First, it tries to remove a "rtc" property, while the rtc_realizefn() added a "rtc-time" property instead. And second, it should have been done in an unrealize function, not in a finalize function, to avoid that this causes problems during introspection. But since adding aliases to the global machine state should not be done from a device's realize function anyway, let's rather fix this issue by moving the creation of the alias to the code that creates the device (and thus is run from the machine init functions instead), i.e. the mc146818_rtc_init() function for most machines. The prep machines are special, since the mc146818rtc device is created here in the realize function of the i82378 device. Since we certainly don't want to add the alias there, we add it to some code that is called from the ibm_40p_init() machine init function instead. Since the alias is now only created during the machine init, we can remove the object_property_del() completely. Fixes: 654a36d857ff949e0d1989904b76f53fded9dc83 Reviewed-by: Markus Armbruster Signed-off-by: Thomas Huth Reviewed-by: Juan Quintela --- hw/ppc/prep.c | 3 +++ hw/timer/mc146818rtc.c | 12 +++--------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 3401570..91a8f42 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -696,6 +696,9 @@ static int prep_set_cmos_checksum(DeviceState *dev, voi= d *opaque) rtc_set_memory(rtc, 0x3e, checksum & 0xff); rtc_set_memory(rtc, 0x2f, checksum >> 8); rtc_set_memory(rtc, 0x3f, checksum >> 8); + + object_property_add_alias(qdev_get_machine(), "rtc-time", OBJECT(r= tc), + "date", NULL); } return 0; } diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c index 3a14075..a504f03 100644 --- a/hw/timer/mc146818rtc.c +++ b/hw/timer/mc146818rtc.c @@ -995,9 +995,6 @@ static void rtc_realizefn(DeviceState *dev, Error **err= p) =20 object_property_add_tm(OBJECT(s), "date", rtc_get_date, NULL); =20 - object_property_add_alias(qdev_get_machine(), "rtc-time", - OBJECT(s), "date", NULL); - qdev_init_gpio_out(dev, &s->irq, 1); } =20 @@ -1019,6 +1016,9 @@ ISADevice *mc146818_rtc_init(ISABus *bus, int base_ye= ar, qemu_irq intercept_irq) } QLIST_INSERT_HEAD(&rtc_devices, s, link); =20 + object_property_add_alias(qdev_get_machine(), "rtc-time", OBJECT(s), + "date", NULL); + return isadev; } =20 @@ -1052,17 +1052,11 @@ static void rtc_class_initfn(ObjectClass *klass, vo= id *data) dc->user_creatable =3D false; } =20 -static void rtc_finalize(Object *obj) -{ - object_property_del(qdev_get_machine(), "rtc", NULL); -} - static const TypeInfo mc146818rtc_info =3D { .name =3D TYPE_MC146818_RTC, .parent =3D TYPE_ISA_DEVICE, .instance_size =3D sizeof(RTCState), .class_init =3D rtc_class_initfn, - .instance_finalize =3D rtc_finalize, }; =20 static void mc146818rtc_register_types(void) --=20 1.8.3.1 From nobody Wed Nov 5 10:35:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534419627289656.0250483095625; Thu, 16 Aug 2018 04:40:27 -0700 (PDT) Received: from localhost ([::1]:54933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGde-0005H8-2U for importer@patchew.org; Thu, 16 Aug 2018 07:40:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGZk-0001KU-Cp for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqGZa-0003Q5-QL for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:20 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59536 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fqGZZ-0003PC-B4 for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:13 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0B3587788C; Thu, 16 Aug 2018 11:36:13 +0000 (UTC) Received: from thuth.com (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D7BD2156716; Thu, 16 Aug 2018 11:36:11 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Thu, 16 Aug 2018 13:35:55 +0200 Message-Id: <1534419358-10932-6-git-send-email-thuth@redhat.com> In-Reply-To: <1534419358-10932-1-git-send-email-thuth@redhat.com> References: <1534419358-10932-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 16 Aug 2018 11:36:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 16 Aug 2018 11:36:13 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 5/8] tests: Skip old versioned machine types in quick testing mode X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , "Michael S. Tsirkin" , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The tests that check something for all machine types currently spend a lot of time checking old machine types (like "pc-i440fx-2.0" for example). The chances that we find something new there in addition to checking the latest version of a machine type are pretty low, so we should not waste the time of the developers by testing this again and again in the "quick" testing mode. Thus let's add some code to determine whether we are testing a current machine type or an old one, and only test the old types if we are running in "SPEED=3Dslow" mode. This decreases the testing time quite a bit now, e.g. the qom-test now finishes within 4 seconds for qemu-system-x86_64 instead of 30 seconds when testing all machines. Signed-off-by: Thomas Huth Reviewed-by: Juan Quintela --- tests/cpu-plug-test.c | 6 +++--- tests/libqtest.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++= ++-- tests/libqtest.h | 4 +++- tests/qom-test.c | 2 +- tests/test-hmp.c | 2 +- 5 files changed, 58 insertions(+), 8 deletions(-) diff --git a/tests/cpu-plug-test.c b/tests/cpu-plug-test.c index f5d57da..3e93c8e 100644 --- a/tests/cpu-plug-test.c +++ b/tests/cpu-plug-test.c @@ -257,11 +257,11 @@ int main(int argc, char **argv) g_test_init(&argc, &argv, NULL); =20 if (strcmp(arch, "i386") =3D=3D 0 || strcmp(arch, "x86_64") =3D=3D 0) { - qtest_cb_for_every_machine(add_pc_test_case); + qtest_cb_for_every_machine(add_pc_test_case, g_test_quick()); } else if (g_str_equal(arch, "ppc64")) { - qtest_cb_for_every_machine(add_pseries_test_case); + qtest_cb_for_every_machine(add_pseries_test_case, g_test_quick()); } else if (g_str_equal(arch, "s390x")) { - qtest_cb_for_every_machine(add_s390x_test_case); + qtest_cb_for_every_machine(add_s390x_test_case, g_test_quick()); } =20 return g_test_run(); diff --git a/tests/libqtest.c b/tests/libqtest.c index 852ccff..1eefad4 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -991,7 +991,53 @@ bool qtest_big_endian(QTestState *s) return s->big_endian; } =20 -void qtest_cb_for_every_machine(void (*cb)(const char *machine)) +static bool qtest_check_machine_version(const char *mname, const char *bas= ename, + int major, int minor) +{ + char *newname; + bool is_equal; + + newname =3D g_strdup_printf("%s-%i.%i", basename, major, minor); + is_equal =3D g_str_equal(mname, newname); + g_free(newname); + + return is_equal; +} + +static bool qtest_is_old_versioned_machine(const char *mname) +{ + const char *dash =3D strrchr(mname, '-'); + const char *dot =3D strrchr(mname, '.'); + const char *chr; + char *bname; + const int major =3D QEMU_VERSION_MAJOR; + const int minor =3D QEMU_VERSION_MINOR; + bool res =3D false; + + if (dash && dot && dot > dash) { + for (chr =3D dash + 1; *chr; chr++) { + if (!isdigit(*chr) && *chr !=3D '.') { + return false; + } + } + /* + * Now check if it is one of the latest versions. Check major + 1 + * and minor + 1 versions as well, since they might already exist + * in the development branch. + */ + bname =3D g_strdup(mname); + bname[dash - mname] =3D 0; + res =3D !qtest_check_machine_version(mname, bname, major + 1, 0) && + !qtest_check_machine_version(mname, bname, major, minor + 1)= && + !qtest_check_machine_version(mname, bname, major, minor); + g_free(bname); + } + + return res; +} + +void qtest_cb_for_every_machine(void (*cb)(const char *machine), + bool skip_old_versioned) { QDict *response, *minfo; QList *list; @@ -1014,7 +1060,9 @@ void qtest_cb_for_every_machine(void (*cb)(const char= *machine)) qstr =3D qobject_to(QString, qobj); g_assert(qstr); mname =3D qstring_get_str(qstr); - cb(mname); + if (!skip_old_versioned || !qtest_is_old_versioned_machine(mname))= { + cb(mname); + } } =20 qtest_end(); diff --git a/tests/libqtest.h b/tests/libqtest.h index def1eda..1159b73 100644 --- a/tests/libqtest.h +++ b/tests/libqtest.h @@ -954,10 +954,12 @@ QDict *qmp_fd(int fd, const char *fmt, ...) GCC_FMT_A= TTR(2, 3); /** * qtest_cb_for_every_machine: * @cb: Pointer to the callback function + * @skip_old_versioned: true if versioned old machine types should be skip= ped * * Call a callback function for every name of all available machines. */ -void qtest_cb_for_every_machine(void (*cb)(const char *machine)); +void qtest_cb_for_every_machine(void (*cb)(const char *machine), + bool skip_old_versioned); =20 /** * qtest_qmp_device_add: diff --git a/tests/qom-test.c b/tests/qom-test.c index e6f712c..73c52af 100644 --- a/tests/qom-test.c +++ b/tests/qom-test.c @@ -123,7 +123,7 @@ int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); =20 - qtest_cb_for_every_machine(add_machine_test_case); + qtest_cb_for_every_machine(add_machine_test_case, g_test_quick()); =20 return g_test_run(); } diff --git a/tests/test-hmp.c b/tests/test-hmp.c index 5352c9c..1a3a9c5 100644 --- a/tests/test-hmp.c +++ b/tests/test-hmp.c @@ -158,7 +158,7 @@ int main(int argc, char **argv) =20 g_test_init(&argc, &argv, NULL); =20 - qtest_cb_for_every_machine(add_machine_test_case); + qtest_cb_for_every_machine(add_machine_test_case, g_test_quick()); =20 /* as none machine has no memory by default, add a test case with memo= ry */ qtest_add_data_func("hmp/none+2MB", g_strdup("none -m 2"), test_machin= e); --=20 1.8.3.1 From nobody Wed Nov 5 10:35:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534419902000918.0510662775908; Thu, 16 Aug 2018 04:45:02 -0700 (PDT) Received: from localhost ([::1]:54956 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGi1-00036b-50 for importer@patchew.org; Thu, 16 Aug 2018 07:44:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGZo-0001LN-0u for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqGZj-0003Sv-2Q for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:27 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:42216 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fqGZc-0003Q2-Jz for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:18 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B3AFF410BC18; Thu, 16 Aug 2018 11:36:14 +0000 (UTC) Received: from thuth.com (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 444242156715; Thu, 16 Aug 2018 11:36:13 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Thu, 16 Aug 2018 13:35:56 +0200 Message-Id: <1534419358-10932-7-git-send-email-thuth@redhat.com> In-Reply-To: <1534419358-10932-1-git-send-email-thuth@redhat.com> References: <1534419358-10932-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 16 Aug 2018 11:36:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 16 Aug 2018 11:36:14 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 6/8] tests/device-introspection: Check that the qom-tree and qtree do not change X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , "Michael S. Tsirkin" , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Introspection should not change the qom-tree / qtree, so we should check this in the device-introspect-test, too. This patch helped to find lots of instrospection bugs during the QEMU v3.0 soft/hard-freeze period in the last two months. Signed-off-by: Thomas Huth Reviewed-by: Juan Quintela --- tests/device-introspect-test.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/device-introspect-test.c b/tests/device-introspect-test.c index 0b4f221..a38193b 100644 --- a/tests/device-introspect-test.c +++ b/tests/device-introspect-test.c @@ -103,7 +103,14 @@ static QList *device_type_list(bool abstract) static void test_one_device(const char *type) { QDict *resp; - char *help, *qom_tree; + char *help; + char *qom_tree_start, *qom_tree_end; + char *qtree_start, *qtree_end; + + g_test_message("Testing device '%s'", type); + + qom_tree_start =3D hmp("info qom-tree"); + qtree_start =3D hmp("info qtree"); =20 resp =3D qmp("{'execute': 'device-list-properties'," " 'arguments': {'typename': %s}}", @@ -115,10 +122,18 @@ static void test_one_device(const char *type) =20 /* * Some devices leave dangling pointers in QOM behind. - * "info qom-tree" has a good chance at crashing then + * "info qom-tree" or "info qtree" have a good chance at crashing then. + * Also make sure that the tree did not change. */ - qom_tree =3D hmp("info qom-tree"); - g_free(qom_tree); + qom_tree_end =3D hmp("info qom-tree"); + g_assert_cmpstr(qom_tree_start, =3D=3D, qom_tree_end); + g_free(qom_tree_start); + g_free(qom_tree_end); + + qtree_end =3D hmp("info qtree"); + g_assert_cmpstr(qtree_start, =3D=3D, qtree_end); + g_free(qtree_start); + g_free(qtree_end); } =20 static void test_device_intro_list(void) --=20 1.8.3.1 From nobody Wed Nov 5 10:35:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534419638907679.1341207060597; Thu, 16 Aug 2018 04:40:38 -0700 (PDT) Received: from localhost ([::1]:54936 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGdp-0005To-QQ for importer@patchew.org; Thu, 16 Aug 2018 07:40:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59310) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGZo-0001LO-0y for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqGZl-0003Tq-Nq for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:27 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59540 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fqGZh-0003Qs-1L for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:22 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C37C7788A; Thu, 16 Aug 2018 11:36:16 +0000 (UTC) Received: from thuth.com (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA7D02166BA0; Thu, 16 Aug 2018 11:36:14 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Thu, 16 Aug 2018 13:35:57 +0200 Message-Id: <1534419358-10932-8-git-send-email-thuth@redhat.com> In-Reply-To: <1534419358-10932-1-git-send-email-thuth@redhat.com> References: <1534419358-10932-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 16 Aug 2018 11:36:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Thu, 16 Aug 2018 11:36:16 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 7/8] tests/device-introspect: Test with all machines, not only with "none" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , "Michael S. Tsirkin" , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Certain device introspection crashes used to only happen if you were using a certain machine, e.g. if the machine was using serial_hd() or nd_table[], and a device was trying to use these in its instance_init function, too. To be able to catch these problems, let's extend the device-introspect test to check the devices on all machine types, with and without the "-nodefaults" parameter (since this makes a difference sometimes, too). Since this is a rather slow operation, and most of the problems are already handled by testing with the "none" machine only, the test with all machines is only run in the "make check SPEED=3Dslow" mode. Reviewed-by: Markus Armbruster Signed-off-by: Thomas Huth Reviewed-by: Juan Quintela --- tests/device-introspect-test.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/tests/device-introspect-test.c b/tests/device-introspect-test.c index a38193b..a25092d 100644 --- a/tests/device-introspect-test.c +++ b/tests/device-introspect-test.c @@ -221,13 +221,13 @@ static void test_device_intro_abstract(void) qtest_end(); } =20 -static void test_device_intro_concrete(void) +static void test_device_intro_concrete(const void *args) { QList *types; QListEntry *entry; const char *type; =20 - qtest_start(common_args); + qtest_start(args); types =3D device_type_list(false); =20 QLIST_FOREACH_ENTRY(types, entry) { @@ -239,6 +239,7 @@ static void test_device_intro_concrete(void) =20 qobject_unref(types); qtest_end(); + g_free((void *)args); } =20 static void test_abstract_interfaces(void) @@ -275,6 +276,26 @@ static void test_abstract_interfaces(void) qtest_end(); } =20 +static void add_machine_test_case(const char *mname) +{ + char *path, *args; + + /* Ignore blacklisted machines */ + if (g_str_equal("xenfv", mname) || g_str_equal("xenpv", mname)) { + return; + } + + path =3D g_strdup_printf("device/introspect/concrete/defaults/%s", mna= me); + args =3D g_strdup_printf("-M %s", mname); + qtest_add_data_func(path, args, test_device_intro_concrete); + g_free(path); + + path =3D g_strdup_printf("device/introspect/concrete/nodefaults/%s", m= name); + args =3D g_strdup_printf("-nodefaults -M %s", mname); + qtest_add_data_func(path, args, test_device_intro_concrete); + g_free(path); +} + int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); @@ -283,8 +304,13 @@ int main(int argc, char **argv) qtest_add_func("device/introspect/list-fields", test_qom_list_fields); qtest_add_func("device/introspect/none", test_device_intro_none); qtest_add_func("device/introspect/abstract", test_device_intro_abstrac= t); - qtest_add_func("device/introspect/concrete", test_device_intro_concret= e); qtest_add_func("device/introspect/abstract-interfaces", test_abstract_= interfaces); + if (g_test_quick()) { + qtest_add_data_func("device/introspect/concrete/defaults/none", + g_strdup(common_args), test_device_intro_concr= ete); + } else { + qtest_cb_for_every_machine(add_machine_test_case, true); + } =20 return g_test_run(); } --=20 1.8.3.1 From nobody Wed Nov 5 10:35:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1534419799683163.01773648978337; Thu, 16 Aug 2018 04:43:19 -0700 (PDT) Received: from localhost ([::1]:54948 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGgM-00026P-FQ for importer@patchew.org; Thu, 16 Aug 2018 07:43:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59311) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fqGZo-0001LP-10 for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fqGZl-0003Ty-Oz for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:27 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34548 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fqGZh-0003RI-Mz for qemu-devel@nongnu.org; Thu, 16 Aug 2018 07:36:23 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1C97DF2B5B; Thu, 16 Aug 2018 11:36:18 +0000 (UTC) Received: from thuth.com (ovpn-116-52.ams2.redhat.com [10.36.116.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id A14D72156716; Thu, 16 Aug 2018 11:36:16 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Thu, 16 Aug 2018 13:35:58 +0200 Message-Id: <1534419358-10932-9-git-send-email-thuth@redhat.com> In-Reply-To: <1534419358-10932-1-git-send-email-thuth@redhat.com> References: <1534419358-10932-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 16 Aug 2018 11:36:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 16 Aug 2018 11:36:18 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 8/8] MAINTAINERS: add maintainers for qtest X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , "Michael S. Tsirkin" , Juan Quintela , Markus Armbruster , "Dr. David Alan Gilbert" , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Paolo Bonzini Thomas has been doing a lot of work on qom-test and device-introspection-te= st, and Laurent has ported libqos to sPAPR and co-mentored Emanuele on the upcoming qtest device framework. They deserve recognition. :) Signed-off-by: Paolo Bonzini Reviewed-by: Laurent Vivier Reviewed-by: John Snow [thuth: removed the hunk that deleted the tests/qom-test.c entry] Signed-off-by: Thomas Huth Reviewed-by: Juan Quintela --- MAINTAINERS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 666e936..072824c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1697,6 +1697,16 @@ F: scripts/qmp/ F: tests/qmp-test.c T: git git://repo.or.cz/qemu/armbru.git qapi-next =20 +qtest +M: Paolo Bonzini +M: Thomas Huth +M: Laurent Vivier +S: Maintained +F: qtest.c +F: tests/libqtest.* +F: tests/libqos/ +F: tests/*-test.c + Register API M: Alistair Francis S: Maintained --=20 1.8.3.1