qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 00/44] Functional test conversion, and assert(0) cleanup
@ 2024-09-25 11:09 Thomas Huth
  2024-09-25 11:09 ` [PULL 01/44] tests/functional/qemu_test: Add a function for launching kernels more easily Thomas Huth
                   ` (45 more replies)
  0 siblings, 46 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

The following changes since commit 01dc65a3bc262ab1bec8fe89775e9bbfa627becb:

  Merge tag 'pull-target-arm-20240919' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-09-19 14:15:15 +0100)

are available in the Git repository at:

  https://gitlab.com/thuth/qemu.git tags/pull-request-2024-09-25

for you to fetch changes up to dc05b2628e3913e668590ba66d9c618382d351ae:

  .gitlab-ci.d: Make separate collapsible log sections for build and test (2024-09-25 09:42:06 +0200)

----------------------------------------------------------------
* Convert more Avocado tests to the new functional test framework
* Clean up assert() statements, use g_assert_not_reached() when possible
* Improve output of the gitlab CI jobs

----------------------------------------------------------------
Peter Maydell (2):
      .gitlab-ci.d: Split build and test in cross build job templates
      .gitlab-ci.d: Make separate collapsible log sections for build and test

Pierrick Bouvier (34):
      hw/acpi: replace assert(0) with g_assert_not_reached()
      hw/arm: replace assert(0) with g_assert_not_reached()
      hw/net: replace assert(0) with g_assert_not_reached()
      migration: replace assert(0) with g_assert_not_reached()
      qobject: replace assert(0) with g_assert_not_reached()
      target/ppc: replace assert(0) with g_assert_not_reached()
      block: replace assert(false) with g_assert_not_reached()
      hw/hyperv: replace assert(false) with g_assert_not_reached()
      hw/net: replace assert(false) with g_assert_not_reached()
      hw/nvme: replace assert(false) with g_assert_not_reached()
      hw/pci: replace assert(false) with g_assert_not_reached()
      hw/ppc: replace assert(false) with g_assert_not_reached()
      migration: replace assert(false) with g_assert_not_reached()
      target/i386/kvm: replace assert(false) with g_assert_not_reached()
      accel/tcg: remove break after g_assert_not_reached()
      block: remove break after g_assert_not_reached()
      hw/acpi: remove break after g_assert_not_reached()
      hw/net: remove break after g_assert_not_reached()
      hw/scsi: remove break after g_assert_not_reached()
      hw/tpm: remove break after g_assert_not_reached()
      target/arm: remove break after g_assert_not_reached()
      target/riscv: remove break after g_assert_not_reached()
      fpu: remove break after g_assert_not_reached()
      tcg/loongarch64: remove break after g_assert_not_reached()
      include/qemu: remove return after g_assert_not_reached()
      hw/hyperv: remove return after g_assert_not_reached()
      hw/net: remove return after g_assert_not_reached()
      hw/pci: remove return after g_assert_not_reached()
      hw/ppc: remove return after g_assert_not_reached()
      migration: remove return after g_assert_not_reached()
      qobject: remove return after g_assert_not_reached()
      qom: remove return after g_assert_not_reached()
      tests/qtest: remove return after g_assert_not_reached()
      scripts/checkpatch.pl: emit error when using assert(false)

Thomas Huth (8):
      tests/functional/qemu_test: Add a function for launching kernels more easily
      tests/functional: Convert the vexpressa9 Avocado test
      tests/functional: Convert the xtensa lx60 Avocado test
      tests/functional: Convert the SPARCStation Avocado test
      tests/functional: Convert the e500 ppc64 Avocado test
      tests/functional: Convert the mac ppc Avocado tests
      tests/functional: Convert the r2d sh4 Avocado test
      tests/functional: Convert the powernv tests from boot_linux_console.py

 MAINTAINERS                               |   7 ++
 include/qemu/pmem.h                       |   1 -
 accel/tcg/plugin-gen.c                    |   1 -
 block/qcow2.c                             |   2 +-
 block/ssh.c                               |   1 -
 hw/acpi/aml-build.c                       |   3 +-
 hw/arm/highbank.c                         |   2 +-
 hw/hyperv/hyperv_testdev.c                |   7 +-
 hw/hyperv/vmbus.c                         |  15 ++--
 hw/net/e1000e_core.c                      |   4 +-
 hw/net/i82596.c                           |   2 +-
 hw/net/igb_core.c                         |   4 +-
 hw/net/net_rx_pkt.c                       |   3 +-
 hw/net/vmxnet3.c                          |   1 -
 hw/nvme/ctrl.c                            |   8 +-
 hw/pci/pci-stub.c                         |   6 +-
 hw/ppc/ppc.c                              |   1 -
 hw/ppc/spapr_events.c                     |   3 +-
 hw/scsi/virtio-scsi.c                     |   1 -
 hw/tpm/tpm_spapr.c                        |   1 -
 migration/dirtyrate.c                     |   3 +-
 migration/migration-hmp-cmds.c            |   2 +-
 migration/postcopy-ram.c                  |  21 ++---
 migration/ram.c                           |   8 +-
 qobject/qlit.c                            |   2 +-
 qobject/qnum.c                            |  12 +--
 qom/object.c                              |   1 -
 target/arm/hyp_gdbstub.c                  |   1 -
 target/i386/kvm/kvm.c                     |   4 +-
 target/ppc/dfp_helper.c                   |   8 +-
 target/ppc/mmu_helper.c                   |   2 +-
 target/riscv/monitor.c                    |   1 -
 tests/qtest/acpi-utils.c                  |   1 -
 fpu/softfloat-parts.c.inc                 |   2 -
 target/riscv/insn_trans/trans_rvv.c.inc   |   2 -
 tcg/loongarch64/tcg-target.c.inc          |   1 -
 .gitlab-ci.d/buildtest-template.yml       |  14 +++
 .gitlab-ci.d/buildtest.yml                |   1 +
 .gitlab-ci.d/crossbuild-template.yml      |  48 ++++++++++-
 scripts/checkpatch.pl                     |   4 +
 scripts/ci/gitlab-ci-section              |  29 +++++++
 tests/avocado/boot_linux_console.py       | 138 ------------------------------
 tests/functional/meson.build              |  15 ++++
 tests/functional/qemu_test/linuxkernel.py |  12 +++
 tests/functional/test_arm_vexpress.py     |  26 ++++++
 tests/functional/test_ppc64_e500.py       |  25 ++++++
 tests/functional/test_ppc64_powernv.py    |  42 ++++++++-
 tests/functional/test_ppc_mac.py          |  38 ++++++++
 tests/functional/test_sh4_r2d.py          |  31 +++++++
 tests/functional/test_sparc_sun4m.py      |  25 ++++++
 tests/functional/test_xtensa_lx60.py      |  26 ++++++
 51 files changed, 384 insertions(+), 234 deletions(-)
 create mode 100644 scripts/ci/gitlab-ci-section
 create mode 100755 tests/functional/test_arm_vexpress.py
 create mode 100755 tests/functional/test_ppc64_e500.py
 create mode 100755 tests/functional/test_ppc_mac.py
 create mode 100755 tests/functional/test_sh4_r2d.py
 create mode 100755 tests/functional/test_sparc_sun4m.py
 create mode 100755 tests/functional/test_xtensa_lx60.py



^ permalink raw reply	[flat|nested] 49+ messages in thread

* [PULL 01/44] tests/functional/qemu_test: Add a function for launching kernels more easily
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 02/44] tests/functional: Convert the vexpressa9 Avocado test Thomas Huth
                   ` (44 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

The task for launching a kernel is quite repetitive: Set the serial
console, set the -kernel and maybe -initrd and -dtb parameters,
launch the VM and then wait for the expected console output. So
it's easier in some tests to provide these steps via a separate
function.

Message-ID: <20240919185749.71222-2-thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/functional/qemu_test/linuxkernel.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/functional/qemu_test/linuxkernel.py b/tests/functional/qemu_test/linuxkernel.py
index fdd5307629..2b5b9a5fda 100644
--- a/tests/functional/qemu_test/linuxkernel.py
+++ b/tests/functional/qemu_test/linuxkernel.py
@@ -17,6 +17,18 @@ def wait_for_console_pattern(self, success_message, vm=None):
                                  failure_message='Kernel panic - not syncing',
                                  vm=vm)
 
+    def launch_kernel(self, kernel, initrd=None, dtb=None, console_index=0,
+                      wait_for=None):
+        self.vm.set_console(console_index=console_index)
+        self.vm.add_args('-kernel', kernel)
+        if initrd:
+                self.vm.add_args('-initrd', initrd)
+        if dtb:
+                self.vm.add_args('-dtb', dtb)
+        self.vm.launch()
+        if wait_for:
+                self.wait_for_console_pattern(wait_for)
+
     def extract_from_deb(self, deb_path, path):
         """
         Extracts a file from a deb package into the test workdir
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 02/44] tests/functional: Convert the vexpressa9 Avocado test
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
  2024-09-25 11:09 ` [PULL 01/44] tests/functional/qemu_test: Add a function for launching kernels more easily Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-30 16:47   ` Peter Maydell
  2024-09-25 11:09 ` [PULL 03/44] tests/functional: Convert the xtensa lx60 " Thomas Huth
                   ` (43 subsequent siblings)
  45 siblings, 1 reply; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

Use the new launch_kernel function to convert this test in a simple way.

Message-ID: <20240919185749.71222-3-thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS                           |  1 +
 tests/avocado/boot_linux_console.py   |  9 ---------
 tests/functional/meson.build          |  1 +
 tests/functional/test_arm_vexpress.py | 26 ++++++++++++++++++++++++++
 4 files changed, 28 insertions(+), 9 deletions(-)
 create mode 100755 tests/functional/test_arm_vexpress.py

diff --git a/MAINTAINERS b/MAINTAINERS
index ffacd60f40..7f7f4c2be6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1005,6 +1005,7 @@ S: Maintained
 F: hw/arm/vexpress.c
 F: hw/display/sii9022.c
 F: docs/system/arm/vexpress.rst
+F: tests/functional/test_arm_vexpress.py
 
 Versatile PB
 M: Peter Maydell <peter.maydell@linaro.org>
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index 6c50284986..7a776c2818 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -893,15 +893,6 @@ def do_test_advcal_2018(self, day, tar_hash, kernel_name, console=0):
         self.vm.launch()
         self.wait_for_console_pattern('QEMU advent calendar')
 
-    def test_arm_vexpressa9(self):
-        """
-        :avocado: tags=arch:arm
-        :avocado: tags=machine:vexpress-a9
-        """
-        tar_hash = '32b7677ce8b6f1471fb0059865f451169934245b'
-        self.vm.add_args('-dtb', self.workdir + '/day16/vexpress-v2p-ca9.dtb')
-        self.do_test_advcal_2018('16', tar_hash, 'winter.zImage')
-
     def test_arm_ast2600_debian(self):
         """
         :avocado: tags=arch:arm
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 8d5520349d..3fc1bb192d 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -50,6 +50,7 @@ tests_arm_system_thorough = [
   'arm_canona1100',
   'arm_integratorcp',
   'arm_raspi2',
+  'arm_vexpress',
 ]
 
 tests_arm_linuxuser_thorough = [
diff --git a/tests/functional/test_arm_vexpress.py b/tests/functional/test_arm_vexpress.py
new file mode 100755
index 0000000000..cc6015112b
--- /dev/null
+++ b/tests/functional/test_arm_vexpress.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a Linux kernel on an versatile express machine
+# and checks the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+
+class VExpressTest(LinuxKernelTest):
+
+    ASSET_DAY16 = Asset(
+        'https://www.qemu-advent-calendar.org/2018/download/day16.tar.xz',
+        '63311adb2d4c4e7a73214a86d29988add87266a909719c56acfadd026b4110a7')
+
+    def test_arm_vexpressa9(self):
+        self.set_machine('vexpress-a9')
+        file_path = self.ASSET_DAY16.fetch()
+        archive_extract(file_path, self.workdir)
+        self.launch_kernel(self.workdir + '/day16/winter.zImage',
+                           dtb=self.workdir + '/day16/vexpress-v2p-ca9.dtb',
+                           wait_for='QEMU advent calendar')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 03/44] tests/functional: Convert the xtensa lx60 Avocado test
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
  2024-09-25 11:09 ` [PULL 01/44] tests/functional/qemu_test: Add a function for launching kernels more easily Thomas Huth
  2024-09-25 11:09 ` [PULL 02/44] tests/functional: Convert the vexpressa9 Avocado test Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 04/44] tests/functional: Convert the SPARCStation " Thomas Huth
                   ` (42 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

Use the new launch_kernel function to convert this test in a simple way.

Message-ID: <20240919185749.71222-4-thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS                          |  1 +
 tests/avocado/boot_linux_console.py  |  9 ---------
 tests/functional/meson.build         |  4 ++++
 tests/functional/test_xtensa_lx60.py | 26 ++++++++++++++++++++++++++
 4 files changed, 31 insertions(+), 9 deletions(-)
 create mode 100755 tests/functional/test_xtensa_lx60.py

diff --git a/MAINTAINERS b/MAINTAINERS
index 7f7f4c2be6..a75d6ba7d2 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1915,6 +1915,7 @@ S: Maintained
 F: hw/xtensa/xtfpga.c
 F: hw/net/opencores_eth.c
 F: include/hw/xtensa/mx_pic.h
+F: tests/functional/test_xtensa_lx60.py
 
 Devices
 -------
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index 7a776c2818..cf58499c84 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -1027,12 +1027,3 @@ def test_sparc_ss20(self):
         """
         tar_hash = 'b18550d5d61c7615d989a06edace051017726a9f'
         self.do_test_advcal_2018('11', tar_hash, 'zImage.elf')
-
-    def test_xtensa_lx60(self):
-        """
-        :avocado: tags=arch:xtensa
-        :avocado: tags=machine:lx60
-        :avocado: tags=cpu:dc233c
-        """
-        tar_hash = '49e88d9933742f0164b60839886c9739cb7a0d34'
-        self.do_test_advcal_2018('02', tar_hash, 'santas-sleigh-ride.elf')
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 3fc1bb192d..8fd852f4ab 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -145,6 +145,10 @@ tests_x86_64_system_thorough = [
   'virtio_gpu',
 ]
 
+tests_xtensa_system_thorough = [
+  'xtensa_lx60',
+]
+
 precache_all = []
 foreach speed : ['quick', 'thorough']
   foreach dir : target_dirs
diff --git a/tests/functional/test_xtensa_lx60.py b/tests/functional/test_xtensa_lx60.py
new file mode 100755
index 0000000000..8ce5206a4f
--- /dev/null
+++ b/tests/functional/test_xtensa_lx60.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a Linux kernel on an xtensa lx650 machine
+# and checks the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+
+class XTensaLX60Test(LinuxKernelTest):
+
+    ASSET_DAY02 = Asset(
+        'https://www.qemu-advent-calendar.org/2018/download/day02.tar.xz',
+        '68ff07f9b3fd3df36d015eb46299ba44748e94bfbb2d5295fddc1a8d4a9fd324')
+
+    def test_xtensa_lx60(self):
+        self.set_machine('lx60')
+        self.cpu = 'dc233c'
+        file_path = self.ASSET_DAY02.fetch()
+        archive_extract(file_path, self.workdir)
+        self.launch_kernel(self.workdir + '/day02/santas-sleigh-ride.elf',
+                           wait_for='QEMU advent calendar')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 04/44] tests/functional: Convert the SPARCStation Avocado test
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (2 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 03/44] tests/functional: Convert the xtensa lx60 " Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 05/44] tests/functional: Convert the e500 ppc64 " Thomas Huth
                   ` (41 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

Use the new launch_kernel function to convert this test in a simple way.

Message-ID: <20240919185749.71222-5-thuth@redhat.com>
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS                          |  1 +
 tests/avocado/boot_linux_console.py  |  8 --------
 tests/functional/meson.build         |  4 ++++
 tests/functional/test_sparc_sun4m.py | 25 +++++++++++++++++++++++++
 4 files changed, 30 insertions(+), 8 deletions(-)
 create mode 100755 tests/functional/test_sparc_sun4m.py

diff --git a/MAINTAINERS b/MAINTAINERS
index a75d6ba7d2..b85a3fc529 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1693,6 +1693,7 @@ F: include/hw/nvram/sun_nvram.h
 F: include/hw/sparc/sparc32_dma.h
 F: include/hw/sparc/sun4m_iommu.h
 F: pc-bios/openbios-sparc32
+F: tests/functional/test_sparc_sun4m.py
 
 Sun4u
 M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index cf58499c84..900af67412 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -1019,11 +1019,3 @@ def test_sh4_r2d(self):
         tar_hash = 'fe06a4fd8ccbf2e27928d64472939d47829d4c7e'
         self.vm.add_args('-append', 'console=ttySC1')
         self.do_test_advcal_2018('09', tar_hash, 'zImage', console=1)
-
-    def test_sparc_ss20(self):
-        """
-        :avocado: tags=arch:sparc
-        :avocado: tags=machine:SS-20
-        """
-        tar_hash = 'b18550d5d61c7615d989a06edace051017726a9f'
-        self.do_test_advcal_2018('11', tar_hash, 'zImage.elf')
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 8fd852f4ab..8aacd15cf3 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -125,6 +125,10 @@ tests_s390x_system_thorough = [
   's390x_topology',
 ]
 
+tests_sparc_system_thorough = [
+  'sparc_sun4m',
+]
+
 tests_sparc64_system_thorough = [
   'sparc64_sun4u',
 ]
diff --git a/tests/functional/test_sparc_sun4m.py b/tests/functional/test_sparc_sun4m.py
new file mode 100755
index 0000000000..b334375820
--- /dev/null
+++ b/tests/functional/test_sparc_sun4m.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+#
+# Functional test that boots a Linux kernel on a sparc sun4m machine
+# and checks the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+
+class Sun4mTest(LinuxKernelTest):
+
+    ASSET_DAY11 = Asset(
+        'https://www.qemu-advent-calendar.org/2018/download/day11.tar.xz',
+        'c776533ba756bf4dd3f1fc4c024fb50ef0d853e05c5f5ddf0900a32d1eaa49e0')
+
+    def test_sparc_ss20(self):
+        self.set_machine('SS-20')
+        file_path = self.ASSET_DAY11.fetch()
+        archive_extract(file_path, self.workdir)
+        self.launch_kernel(self.workdir + '/day11/zImage.elf',
+                           wait_for='QEMU advent calendar')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 05/44] tests/functional: Convert the e500 ppc64 Avocado test
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (3 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 04/44] tests/functional: Convert the SPARCStation " Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 06/44] tests/functional: Convert the mac ppc Avocado tests Thomas Huth
                   ` (40 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

Use the new launch_kernel function to convert this test in a simple way.

Message-ID: <20240919185749.71222-6-thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS                         |  1 +
 tests/avocado/boot_linux_console.py | 11 -----------
 tests/functional/meson.build        |  1 +
 tests/functional/test_ppc64_e500.py | 25 +++++++++++++++++++++++++
 4 files changed, 27 insertions(+), 11 deletions(-)
 create mode 100755 tests/functional/test_ppc64_e500.py

diff --git a/MAINTAINERS b/MAINTAINERS
index b85a3fc529..3dd80a0138 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1445,6 +1445,7 @@ F: pc-bios/u-boot.e500
 F: hw/intc/openpic_kvm.c
 F: include/hw/ppc/openpic_kvm.h
 F: docs/system/ppc/ppce500.rst
+F: tests/functional/test_ppc64_e500.py
 
 mpc8544ds
 L: qemu-ppc@nongnu.org
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index 900af67412..344c7835a2 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -918,17 +918,6 @@ def test_arm_ast2600_debian(self):
         self.wait_for_console_pattern("SMP: Total of 2 processors activated")
         self.wait_for_console_pattern("No filesystem could mount root")
 
-    def test_ppc64_e500(self):
-        """
-        :avocado: tags=arch:ppc64
-        :avocado: tags=machine:ppce500
-        :avocado: tags=cpu:e5500
-        :avocado: tags=accel:tcg
-        """
-        self.require_accelerator("tcg")
-        tar_hash = '6951d86d644b302898da2fd701739c9406527fe1'
-        self.do_test_advcal_2018('19', tar_hash, 'uImage')
-
     def do_test_ppc64_powernv(self, proc):
         self.require_accelerator("tcg")
         images_url = ('https://github.com/open-power/op-build/releases/download/v2.7/')
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 8aacd15cf3..bc33332313 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -111,6 +111,7 @@ tests_ppc_system_thorough = [
 ]
 
 tests_ppc64_system_thorough = [
+  'ppc64_e500',
   'ppc64_hv',
   'ppc64_powernv',
   'ppc64_pseries',
diff --git a/tests/functional/test_ppc64_e500.py b/tests/functional/test_ppc64_e500.py
new file mode 100755
index 0000000000..3558ae0c8c
--- /dev/null
+++ b/tests/functional/test_ppc64_e500.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+#
+# Boot a Linux kernel on a e500 ppc64 machine and check the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+
+class E500Test(LinuxKernelTest):
+
+    ASSET_DAY19 = Asset(
+        'https://www.qemu-advent-calendar.org/2018/download/day19.tar.xz',
+        '20b1bb5a8488c664defbb5d283addc91a05335a936c63b3f5ff7eee74b725755')
+
+    def test_ppc64_e500(self):
+        self.set_machine('ppce500')
+        self.cpu = 'e5500'
+        file_path = self.ASSET_DAY19.fetch()
+        archive_extract(file_path, self.workdir)
+        self.launch_kernel(self.workdir + '/day19/uImage',
+                           wait_for='QEMU advent calendar')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 06/44] tests/functional: Convert the mac ppc Avocado tests
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (4 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 05/44] tests/functional: Convert the e500 ppc64 " Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 07/44] tests/functional: Convert the r2d sh4 Avocado test Thomas Huth
                   ` (39 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

The g3beige and mac99 tests use the same asset, so put them together
in a new test_ppc_mac.py file.

Message-ID: <20240919185749.71222-7-thuth@redhat.com>
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS                         |  2 ++
 tests/avocado/boot_linux_console.py | 30 -----------------------
 tests/functional/meson.build        |  1 +
 tests/functional/test_ppc_mac.py    | 38 +++++++++++++++++++++++++++++
 4 files changed, 41 insertions(+), 30 deletions(-)
 create mode 100755 tests/functional/test_ppc_mac.py

diff --git a/MAINTAINERS b/MAINTAINERS
index 3dd80a0138..63eb306d6e 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1474,6 +1474,7 @@ F: include/hw/ppc/mac_dbdma.h
 F: include/hw/pci-host/uninorth.h
 F: include/hw/input/adb*
 F: pc-bios/qemu_vga.ndrv
+F: tests/functional/test_ppc_mac.py
 
 Old World (g3beige)
 M: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
@@ -1489,6 +1490,7 @@ F: include/hw/intc/heathrow_pic.h
 F: include/hw/input/adb*
 F: include/hw/pci-host/grackle.h
 F: pc-bios/qemu_vga.ndrv
+F: tests/functional/test_ppc_mac.py
 
 PReP
 M: Hervé Poussineau <hpoussin@reactos.org>
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index 344c7835a2..f5dc9e9cfa 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -965,36 +965,6 @@ def test_ppc_powernv10(self):
         """
         self.do_test_ppc64_powernv('P10')
 
-    def test_ppc_g3beige(self):
-        """
-        :avocado: tags=arch:ppc
-        :avocado: tags=machine:g3beige
-        :avocado: tags=accel:tcg
-        """
-        # TODO: g3beige works with kvm_pr but we don't have a
-        # reliable way ATM (e.g. looking at /proc/modules) to detect
-        # whether we're running kvm_hv or kvm_pr. For now let's
-        # disable this test if we don't have TCG support.
-        self.require_accelerator("tcg")
-        tar_hash = 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
-        self.vm.add_args('-M', 'graphics=off')
-        self.do_test_advcal_2018('15', tar_hash, 'invaders.elf')
-
-    def test_ppc_mac99(self):
-        """
-        :avocado: tags=arch:ppc
-        :avocado: tags=machine:mac99
-        :avocado: tags=accel:tcg
-        """
-        # TODO: mac99 works with kvm_pr but we don't have a
-        # reliable way ATM (e.g. looking at /proc/modules) to detect
-        # whether we're running kvm_hv or kvm_pr. For now let's
-        # disable this test if we don't have TCG support.
-        self.require_accelerator("tcg")
-        tar_hash = 'e0b872a5eb8fdc5bed19bd43ffe863900ebcedfc'
-        self.vm.add_args('-M', 'graphics=off')
-        self.do_test_advcal_2018('15', tar_hash, 'invaders.elf')
-
     # This test has a 6-10% failure rate on various hosts that look
     # like issues with a buggy kernel. As a result we don't want it
     # gating releases on Gitlab.
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index bc33332313..449c6a95ea 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -106,6 +106,7 @@ tests_ppc_system_thorough = [
   'ppc_40p',
   'ppc_amiga',
   'ppc_bamboo',
+  'ppc_mac',
   'ppc_mpc8544ds',
   'ppc_virtex_ml507',
 ]
diff --git a/tests/functional/test_ppc_mac.py b/tests/functional/test_ppc_mac.py
new file mode 100755
index 0000000000..a6b1ca2d4c
--- /dev/null
+++ b/tests/functional/test_ppc_mac.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+#
+# Boot Linux kernel on a mac99 and g3beige ppc machine and check the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+
+class MacTest(LinuxKernelTest):
+
+    ASSET_DAY15 = Asset(
+        'https://www.qemu-advent-calendar.org/2018/download/day15.tar.xz',
+        '03e0757c131d2959decf293a3572d3b96c5a53587165bf05ce41b2818a2bccd5')
+
+    def do_day15_test(self):
+        # mac99 also works with kvm_pr but we don't have a reliable way at
+        # the moment (e.g. by looking at /proc/modules) to detect whether
+        # we're running kvm_hv or kvm_pr. For now let's disable this test
+        # if we don't have TCG support.
+        self.require_accelerator("tcg")
+
+        file_path = self.ASSET_DAY15.fetch()
+        archive_extract(file_path, self.workdir)
+        self.vm.add_args('-M', 'graphics=off')
+        self.launch_kernel(self.workdir + '/day15/invaders.elf',
+                           wait_for='QEMU advent calendar')
+
+    def test_ppc_g3beige(self):
+        self.set_machine('g3beige')
+        self.do_day15_test()
+
+    def test_ppc_mac99(self):
+        self.set_machine('mac99')
+        self.do_day15_test()
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 07/44] tests/functional: Convert the r2d sh4 Avocado test
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (5 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 06/44] tests/functional: Convert the mac ppc Avocado tests Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 08/44] tests/functional: Convert the powernv tests from boot_linux_console.py Thomas Huth
                   ` (38 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

This is the last test that is using the do_test_advcal_2018()
function, so we can now remove that function from boot_linux_console.py,
too.

Message-ID: <20240919185749.71222-8-thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 MAINTAINERS                         |  1 +
 tests/avocado/boot_linux_console.py | 25 -----------------------
 tests/functional/meson.build        |  4 ++++
 tests/functional/test_sh4_r2d.py    | 31 +++++++++++++++++++++++++++++
 4 files changed, 36 insertions(+), 25 deletions(-)
 create mode 100755 tests/functional/test_sh4_r2d.py

diff --git a/MAINTAINERS b/MAINTAINERS
index 63eb306d6e..62f5255f40 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1679,6 +1679,7 @@ F: hw/pci-host/sh_pci.c
 F: hw/timer/sh_timer.c
 F: include/hw/sh4/sh_intc.h
 F: include/hw/timer/tmu012.h
+F: tests/functional/test_sh4_r2d.py
 
 SPARC Machines
 --------------
diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index f5dc9e9cfa..759fda9cc8 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -882,17 +882,6 @@ def test_arm_orangepi_uboot_netbsd9(self):
         # Wait for user-space
         wait_for_console_pattern(self, 'Starting root file system check')
 
-    def do_test_advcal_2018(self, day, tar_hash, kernel_name, console=0):
-        tar_url = ('https://qemu-advcal.gitlab.io'
-                   '/qac-best-of-multiarch/download/day' + day + '.tar.xz')
-        file_path = self.fetch_asset(tar_url, asset_hash=tar_hash)
-        archive.extract(file_path, self.workdir)
-        self.vm.set_console(console_index=console)
-        self.vm.add_args('-kernel',
-                         self.workdir + '/day' + day + '/' + kernel_name)
-        self.vm.launch()
-        self.wait_for_console_pattern('QEMU advent calendar')
-
     def test_arm_ast2600_debian(self):
         """
         :avocado: tags=arch:arm
@@ -964,17 +953,3 @@ def test_ppc_powernv10(self):
         :avocado: tags=accel:tcg
         """
         self.do_test_ppc64_powernv('P10')
-
-    # This test has a 6-10% failure rate on various hosts that look
-    # like issues with a buggy kernel. As a result we don't want it
-    # gating releases on Gitlab.
-    @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable on GitLab')
-    def test_sh4_r2d(self):
-        """
-        :avocado: tags=arch:sh4
-        :avocado: tags=machine:r2d
-        :avocado: tags=flaky
-        """
-        tar_hash = 'fe06a4fd8ccbf2e27928d64472939d47829d4c7e'
-        self.vm.add_args('-append', 'console=ttySC1')
-        self.do_test_advcal_2018('09', tar_hash, 'zImage', console=1)
diff --git a/tests/functional/meson.build b/tests/functional/meson.build
index 449c6a95ea..56a541530f 100644
--- a/tests/functional/meson.build
+++ b/tests/functional/meson.build
@@ -127,6 +127,10 @@ tests_s390x_system_thorough = [
   's390x_topology',
 ]
 
+tests_sh4_system_thorough = [
+  'sh4_r2d',
+]
+
 tests_sparc_system_thorough = [
   'sparc_sun4m',
 ]
diff --git a/tests/functional/test_sh4_r2d.py b/tests/functional/test_sh4_r2d.py
new file mode 100755
index 0000000000..5fe8cf9f8d
--- /dev/null
+++ b/tests/functional/test_sh4_r2d.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python3
+#
+# Boot a Linux kernel on a r2d sh4 machine and check the console
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+import os
+
+from qemu_test import LinuxKernelTest, Asset
+from qemu_test.utils import archive_extract
+from unittest import skipUnless
+
+class R2dTest(LinuxKernelTest):
+
+    ASSET_DAY09 = Asset(
+        'https://www.qemu-advent-calendar.org/2018/download/day09.tar.xz',
+        'a61b44d2630a739d1380cc4ff4b80981d47ccfd5992f1484ccf48322c35f09ac')
+
+    # This test has a 6-10% failure rate on various hosts that look
+    # like issues with a buggy kernel.
+    @skipUnless(os.getenv('QEMU_TEST_FLAKY_TESTS'), 'Test is unstable')
+    def test_r2d(self):
+        self.set_machine('r2d')
+        file_path = self.ASSET_DAY09.fetch()
+        archive_extract(file_path, self.workdir)
+        self.vm.add_args('-append', 'console=ttySC1')
+        self.launch_kernel(self.workdir + '/day09/zImage', console_index=1,
+                           wait_for='QEMU advent calendar')
+
+if __name__ == '__main__':
+    LinuxKernelTest.main()
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 08/44] tests/functional: Convert the powernv tests from boot_linux_console.py
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (6 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 07/44] tests/functional: Convert the r2d sh4 Avocado test Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 09/44] hw/acpi: replace assert(0) with g_assert_not_reached() Thomas Huth
                   ` (37 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

Move the tests into the already existing test_ppc64_powernv.py
file.

Message-ID: <20240920150319.81723-1-thuth@redhat.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/avocado/boot_linux_console.py    | 46 --------------------------
 tests/functional/test_ppc64_powernv.py | 42 +++++++++++++++++++++--
 2 files changed, 39 insertions(+), 49 deletions(-)

diff --git a/tests/avocado/boot_linux_console.py b/tests/avocado/boot_linux_console.py
index 759fda9cc8..23d1b3587b 100644
--- a/tests/avocado/boot_linux_console.py
+++ b/tests/avocado/boot_linux_console.py
@@ -907,49 +907,3 @@ def test_arm_ast2600_debian(self):
         self.wait_for_console_pattern("SMP: Total of 2 processors activated")
         self.wait_for_console_pattern("No filesystem could mount root")
 
-    def do_test_ppc64_powernv(self, proc):
-        self.require_accelerator("tcg")
-        images_url = ('https://github.com/open-power/op-build/releases/download/v2.7/')
-
-        kernel_url = images_url + 'zImage.epapr'
-        kernel_hash = '0ab237df661727e5392cee97460e8674057a883c5f74381a128fa772588d45cd'
-        kernel_path = self.fetch_asset(kernel_url, asset_hash=kernel_hash,
-                                       algorithm='sha256')
-        self.vm.set_console()
-        self.vm.add_args('-kernel', kernel_path,
-                         '-append', 'console=tty0 console=hvc0',
-                         '-device', 'pcie-pci-bridge,id=bridge1,bus=pcie.1,addr=0x0',
-                         '-device', 'nvme,bus=pcie.2,addr=0x0,serial=1234',
-                         '-device', 'e1000e,bus=bridge1,addr=0x3',
-                         '-device', 'nec-usb-xhci,bus=bridge1,addr=0x2')
-        self.vm.launch()
-
-        self.wait_for_console_pattern("CPU: " + proc + " generation processor")
-        self.wait_for_console_pattern("zImage starting: loaded")
-        self.wait_for_console_pattern("Run /init as init process")
-        # Device detection output driven by udev probing is sometimes cut off
-        # from console output, suspect S14silence-console init script.
-
-    def test_ppc_powernv8(self):
-        """
-        :avocado: tags=arch:ppc64
-        :avocado: tags=machine:powernv8
-        :avocado: tags=accel:tcg
-        """
-        self.do_test_ppc64_powernv('P8')
-
-    def test_ppc_powernv9(self):
-        """
-        :avocado: tags=arch:ppc64
-        :avocado: tags=machine:powernv9
-        :avocado: tags=accel:tcg
-        """
-        self.do_test_ppc64_powernv('P9')
-
-    def test_ppc_powernv10(self):
-        """
-        :avocado: tags=arch:ppc64
-        :avocado: tags=machine:powernv10
-        :avocado: tags=accel:tcg
-        """
-        self.do_test_ppc64_powernv('P10')
diff --git a/tests/functional/test_ppc64_powernv.py b/tests/functional/test_ppc64_powernv.py
index 67497d6404..685e2178ed 100755
--- a/tests/functional/test_ppc64_powernv.py
+++ b/tests/functional/test_ppc64_powernv.py
@@ -7,10 +7,10 @@
 # This work is licensed under the terms of the GNU GPL, version 2 or
 # later.  See the COPYING file in the top-level directory.
 
-from qemu_test import QemuSystemTest, Asset
+from qemu_test import LinuxKernelTest, Asset
 from qemu_test import wait_for_console_pattern
 
-class powernvMachine(QemuSystemTest):
+class powernvMachine(LinuxKernelTest):
 
     timeout = 90
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 console=hvc0 '
@@ -78,5 +78,41 @@ def test_linux_big_boot(self):
         wait_for_console_pattern(self, console_pattern, self.panic_message)
         wait_for_console_pattern(self, self.good_message, self.panic_message)
 
+
+    ASSET_EPAPR_KERNEL = Asset(
+        ('https://github.com/open-power/op-build/releases/download/v2.7/'
+         'zImage.epapr'),
+        '0ab237df661727e5392cee97460e8674057a883c5f74381a128fa772588d45cd')
+
+    def do_test_ppc64_powernv(self, proc):
+        self.require_accelerator("tcg")
+        kernel_path = self.ASSET_EPAPR_KERNEL.fetch()
+        self.vm.set_console()
+        self.vm.add_args('-kernel', kernel_path,
+                         '-append', 'console=tty0 console=hvc0',
+                         '-device', 'pcie-pci-bridge,id=bridge1,bus=pcie.1,addr=0x0',
+                         '-device', 'nvme,bus=pcie.2,addr=0x0,serial=1234',
+                         '-device', 'e1000e,bus=bridge1,addr=0x3',
+                         '-device', 'nec-usb-xhci,bus=bridge1,addr=0x2')
+        self.vm.launch()
+
+        self.wait_for_console_pattern("CPU: " + proc + " generation processor")
+        self.wait_for_console_pattern("zImage starting: loaded")
+        self.wait_for_console_pattern("Run /init as init process")
+        # Device detection output driven by udev probing is sometimes cut off
+        # from console output, suspect S14silence-console init script.
+
+    def test_powernv8(self):
+        self.set_machine('powernv8')
+        self.do_test_ppc64_powernv('P8')
+
+    def test_powernv9(self):
+        self.set_machine('powernv9')
+        self.do_test_ppc64_powernv('P9')
+
+    def test_powernv10(self):
+        self.set_machine('powernv10')
+        self.do_test_ppc64_powernv('P10')
+
 if __name__ == '__main__':
-    QemuSystemTest.main()
+    LinuxKernelTest.main()
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 09/44] hw/acpi: replace assert(0) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (7 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 08/44] tests/functional: Convert the powernv tests from boot_linux_console.py Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 10/44] hw/arm: " Thomas Huth
                   ` (36 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-2-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/acpi/aml-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index 6d4517cfbe..006c506a37 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -534,7 +534,7 @@ void aml_append(Aml *parent_ctx, Aml *child)
     case AML_NO_OPCODE:
         break;
     default:
-        assert(0);
+        g_assert_not_reached();
         break;
     }
     build_append_array(parent_ctx->buf, buf);
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 10/44] hw/arm: replace assert(0) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (8 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 09/44] hw/acpi: replace assert(0) with g_assert_not_reached() Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 11/44] hw/net: " Thomas Huth
                   ` (35 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-3-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/arm/highbank.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index 6915eb63c7..f103921d49 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -199,7 +199,7 @@ static void calxeda_init(MachineState *machine, enum cxmachines machine_id)
         machine->cpu_type = ARM_CPU_TYPE_NAME("cortex-a15");
         break;
     default:
-        assert(0);
+        g_assert_not_reached();
     }
 
     for (n = 0; n < smp_cpus; n++) {
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 11/44] hw/net: replace assert(0) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (9 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 10/44] hw/arm: " Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 12/44] migration: " Thomas Huth
                   ` (34 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-4-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/net/i82596.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/i82596.c b/hw/net/i82596.c
index 6cc8292a65..cd416a00ff 100644
--- a/hw/net/i82596.c
+++ b/hw/net/i82596.c
@@ -282,7 +282,7 @@ static void command_loop(I82596State *s)
         case CmdDump:
         case CmdDiagnose:
             printf("FIXME Command %d !!\n", cmd & 7);
-            assert(0);
+            g_assert_not_reached();
         }
 
         /* update status */
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 12/44] migration: replace assert(0) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (10 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 11/44] hw/net: " Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 13/44] qobject: " Thomas Huth
                   ` (33 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240919044641.386068-5-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 migration/migration-hmp-cmds.c |  2 +-
 migration/postcopy-ram.c       | 14 +++++++-------
 migration/ram.c                |  6 +++---
 3 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c
index 28165cfc9e..20d1a6e219 100644
--- a/migration/migration-hmp-cmds.c
+++ b/migration/migration-hmp-cmds.c
@@ -640,7 +640,7 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict)
         visit_type_bool(v, param, &p->direct_io, &err);
         break;
     default:
-        assert(0);
+        g_assert_not_reached();
     }
 
     if (err) {
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 1c374b7ea1..f431bbc0d4 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -1411,40 +1411,40 @@ int postcopy_ram_incoming_init(MigrationIncomingState *mis)
 
 int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis)
 {
-    assert(0);
+    g_assert_not_reached();
     return -1;
 }
 
 int postcopy_ram_prepare_discard(MigrationIncomingState *mis)
 {
-    assert(0);
+    g_assert_not_reached();
     return -1;
 }
 
 int postcopy_request_shared_page(struct PostCopyFD *pcfd, RAMBlock *rb,
                                  uint64_t client_addr, uint64_t rb_offset)
 {
-    assert(0);
+    g_assert_not_reached();
     return -1;
 }
 
 int postcopy_ram_incoming_setup(MigrationIncomingState *mis)
 {
-    assert(0);
+    g_assert_not_reached();
     return -1;
 }
 
 int postcopy_place_page(MigrationIncomingState *mis, void *host, void *from,
                         RAMBlock *rb)
 {
-    assert(0);
+    g_assert_not_reached();
     return -1;
 }
 
 int postcopy_place_page_zero(MigrationIncomingState *mis, void *host,
                         RAMBlock *rb)
 {
-    assert(0);
+    g_assert_not_reached();
     return -1;
 }
 
@@ -1452,7 +1452,7 @@ int postcopy_wake_shared(struct PostCopyFD *pcfd,
                          uint64_t client_addr,
                          RAMBlock *rb)
 {
-    assert(0);
+    g_assert_not_reached();
     return -1;
 }
 #endif
diff --git a/migration/ram.c b/migration/ram.c
index 67ca3d5d51..0aa5d34743 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1765,19 +1765,19 @@ bool ram_write_tracking_available(void)
 
 bool ram_write_tracking_compatible(void)
 {
-    assert(0);
+    g_assert_not_reached();
     return false;
 }
 
 int ram_write_tracking_start(void)
 {
-    assert(0);
+    g_assert_not_reached();
     return -1;
 }
 
 void ram_write_tracking_stop(void)
 {
-    assert(0);
+    g_assert_not_reached();
 }
 #endif /* defined(__linux__) */
 
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 13/44] qobject: replace assert(0) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (11 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 12/44] migration: " Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 14/44] target/ppc: " Thomas Huth
                   ` (32 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-6-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 qobject/qlit.c | 2 +-
 qobject/qnum.c | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/qobject/qlit.c b/qobject/qlit.c
index be8332136c..a62865b642 100644
--- a/qobject/qlit.c
+++ b/qobject/qlit.c
@@ -118,7 +118,7 @@ QObject *qobject_from_qlit(const QLitObject *qlit)
     case QTYPE_QBOOL:
         return QOBJECT(qbool_from_bool(qlit->value.qbool));
     default:
-        assert(0);
+        g_assert_not_reached();
     }
 
     return NULL;
diff --git a/qobject/qnum.c b/qobject/qnum.c
index 2bbeaedc7b..2138b563a9 100644
--- a/qobject/qnum.c
+++ b/qobject/qnum.c
@@ -85,7 +85,7 @@ bool qnum_get_try_int(const QNum *qn, int64_t *val)
         return false;
     }
 
-    assert(0);
+    g_assert_not_reached();
     return false;
 }
 
@@ -123,7 +123,7 @@ bool qnum_get_try_uint(const QNum *qn, uint64_t *val)
         return false;
     }
 
-    assert(0);
+    g_assert_not_reached();
     return false;
 }
 
@@ -156,7 +156,7 @@ double qnum_get_double(QNum *qn)
         return qn->u.dbl;
     }
 
-    assert(0);
+    g_assert_not_reached();
     return 0.0;
 }
 
@@ -172,7 +172,7 @@ char *qnum_to_string(QNum *qn)
         return g_strdup_printf("%.17g", qn->u.dbl);
     }
 
-    assert(0);
+    g_assert_not_reached();
     return NULL;
 }
 
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 14/44] target/ppc: replace assert(0) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (12 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 13/44] qobject: " Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 15/44] block: replace assert(false) " Thomas Huth
                   ` (31 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-7-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/ppc/dfp_helper.c | 8 ++++----
 target/ppc/mmu_helper.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/target/ppc/dfp_helper.c b/target/ppc/dfp_helper.c
index 5967ea07a9..ecc3f79326 100644
--- a/target/ppc/dfp_helper.c
+++ b/target/ppc/dfp_helper.c
@@ -249,7 +249,7 @@ static void dfp_set_FPRF_from_FRT_with_context(struct PPC_DFP *dfp,
         fprf = 0x05;
         break;
     default:
-        assert(0); /* should never get here */
+        g_assert_not_reached();
     }
     dfp->env->fpscr &= ~FP_FPRF;
     dfp->env->fpscr |= (fprf << FPSCR_FPRF);
@@ -1243,7 +1243,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *b) \
         } else if (decNumberIsQNaN(&dfp.b)) {                  \
             vt.VsrD(1) = -2;                                   \
         } else {                                               \
-            assert(0);                                         \
+            g_assert_not_reached();                            \
         }                                                      \
         set_dfp64(t, &vt);                                     \
     } else {                                                   \
@@ -1252,7 +1252,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *b) \
         } else if ((size) == 128) {                            \
             vt.VsrD(1) = dfp.b.exponent + 6176;                \
         } else {                                               \
-            assert(0);                                         \
+            g_assert_not_reached();                            \
         }                                                      \
         set_dfp64(t, &vt);                                     \
     }                                                          \
@@ -1300,7 +1300,7 @@ void helper_##op(CPUPPCState *env, ppc_fprp_t *t, ppc_fprp_t *a,          \
         raw_inf = 0x1e000;                                                \
         bias = 6176;                                                      \
     } else {                                                              \
-        assert(0);                                                        \
+        g_assert_not_reached();                                           \
     }                                                                     \
                                                                           \
     if (unlikely((exp < 0) || (exp > max_exp))) {                         \
diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c
index b0a0676beb..b167b37e0a 100644
--- a/target/ppc/mmu_helper.c
+++ b/target/ppc/mmu_helper.c
@@ -316,7 +316,7 @@ void ppc_tlb_invalidate_one(CPUPPCState *env, target_ulong addr)
         break;
     default:
         /* Should never reach here with other MMU models */
-        assert(0);
+        g_assert_not_reached();
     }
 #else
     ppc_tlb_invalidate_all(env);
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 15/44] block: replace assert(false) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (13 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 14/44] target/ppc: " Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 16/44] hw/hyperv: " Thomas Huth
                   ` (30 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-8-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 block/qcow2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/qcow2.c b/block/qcow2.c
index dd359d241b..803ca73a2f 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -5299,7 +5299,7 @@ qcow2_get_specific_info(BlockDriverState *bs, Error **errp)
     } else {
         /* if this assertion fails, this probably means a new version was
          * added without having it covered here */
-        assert(false);
+        g_assert_not_reached();
     }
 
     if (encrypt_info) {
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 16/44] hw/hyperv: replace assert(false) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (14 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 15/44] block: replace assert(false) " Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 17/44] hw/net: " Thomas Huth
                   ` (29 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-9-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/hyperv/hyperv_testdev.c |  6 +++---
 hw/hyperv/vmbus.c          | 12 ++++++------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/hw/hyperv/hyperv_testdev.c b/hw/hyperv/hyperv_testdev.c
index 9a56ddf83f..ef50e490c4 100644
--- a/hw/hyperv/hyperv_testdev.c
+++ b/hw/hyperv/hyperv_testdev.c
@@ -88,7 +88,7 @@ static TestSintRoute *sint_route_find(HypervTestDev *dev,
             return sint_route;
         }
     }
-    assert(false);
+    g_assert_not_reached();
     return NULL;
 }
 
@@ -187,7 +187,7 @@ static void msg_conn_destroy(HypervTestDev *dev, uint8_t conn_id)
             return;
         }
     }
-    assert(false);
+    g_assert_not_reached();
 }
 
 static void evt_conn_handler(EventNotifier *notifier)
@@ -237,7 +237,7 @@ static void evt_conn_destroy(HypervTestDev *dev, uint8_t conn_id)
             return;
         }
     }
-    assert(false);
+    g_assert_not_reached();
 }
 
 static uint64_t hv_test_dev_read(void *opaque, hwaddr addr, unsigned size)
diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
index 15e0d600c7..03f415bf22 100644
--- a/hw/hyperv/vmbus.c
+++ b/hw/hyperv/vmbus.c
@@ -1874,7 +1874,7 @@ static void send_create_gpadl(VMBus *vmbus)
         }
     }
 
-    assert(false);
+    g_assert_not_reached();
 }
 
 static bool complete_create_gpadl(VMBus *vmbus)
@@ -1889,7 +1889,7 @@ static bool complete_create_gpadl(VMBus *vmbus)
         }
     }
 
-    assert(false);
+    g_assert_not_reached();
     return false;
 }
 
@@ -1931,7 +1931,7 @@ static void send_teardown_gpadl(VMBus *vmbus)
         }
     }
 
-    assert(false);
+    g_assert_not_reached();
 }
 
 static bool complete_teardown_gpadl(VMBus *vmbus)
@@ -1946,7 +1946,7 @@ static bool complete_teardown_gpadl(VMBus *vmbus)
         }
     }
 
-    assert(false);
+    g_assert_not_reached();
     return false;
 }
 
@@ -1996,7 +1996,7 @@ static void send_open_channel(VMBus *vmbus)
         }
     }
 
-    assert(false);
+    g_assert_not_reached();
 }
 
 static bool complete_open_channel(VMBus *vmbus)
@@ -2020,7 +2020,7 @@ static bool complete_open_channel(VMBus *vmbus)
         }
     }
 
-    assert(false);
+    g_assert_not_reached();
     return false;
 }
 
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 17/44] hw/net: replace assert(false) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (15 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 16/44] hw/hyperv: " Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:09 ` [PULL 18/44] hw/nvme: " Thomas Huth
                   ` (28 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-10-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/net/e1000e_core.c | 2 +-
 hw/net/igb_core.c    | 2 +-
 hw/net/net_rx_pkt.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index 3ae2a184d5..248381f976 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -561,7 +561,7 @@ e1000e_rss_calc_hash(E1000ECore *core,
         type = NetPktRssIpV6Ex;
         break;
     default:
-        assert(false);
+        g_assert_not_reached();
         return 0;
     }
 
diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c
index bcd5f6cd9c..6be6140771 100644
--- a/hw/net/igb_core.c
+++ b/hw/net/igb_core.c
@@ -397,7 +397,7 @@ igb_rss_calc_hash(IGBCore *core, struct NetRxPkt *pkt, E1000E_RSSInfo *info)
         type = NetPktRssIpV6Udp;
         break;
     default:
-        assert(false);
+        g_assert_not_reached();
         return 0;
     }
 
diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c
index 32e5f3f9cf..6b9c4c9559 100644
--- a/hw/net/net_rx_pkt.c
+++ b/hw/net/net_rx_pkt.c
@@ -375,7 +375,7 @@ net_rx_pkt_calc_rss_hash(struct NetRxPkt *pkt,
         _net_rx_rss_prepare_udp(&rss_input[0], pkt, &rss_length);
         break;
     default:
-        assert(false);
+        g_assert_not_reached();
         break;
     }
 
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 18/44] hw/nvme: replace assert(false) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (16 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 17/44] hw/net: " Thomas Huth
@ 2024-09-25 11:09 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 19/44] hw/pci: " Thomas Huth
                   ` (27 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-11-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/nvme/ctrl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index 9e94a24054..2589e1968e 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -1816,7 +1816,7 @@ static uint16_t nvme_check_zone_state_for_write(NvmeZone *zone)
         trace_pci_nvme_err_zone_is_read_only(zslba);
         return NVME_ZONE_READ_ONLY;
     default:
-        assert(false);
+        g_assert_not_reached();
     }
 
     return NVME_INTERNAL_DEV_ERROR;
@@ -1870,7 +1870,7 @@ static uint16_t nvme_check_zone_state_for_read(NvmeZone *zone)
         trace_pci_nvme_err_zone_is_offline(zone->d.zslba);
         return NVME_ZONE_OFFLINE;
     default:
-        assert(false);
+        g_assert_not_reached();
     }
 
     return NVME_INTERNAL_DEV_ERROR;
@@ -4654,7 +4654,7 @@ static uint16_t nvme_io_cmd(NvmeCtrl *n, NvmeRequest *req)
     case NVME_CMD_IO_MGMT_SEND:
         return nvme_io_mgmt_send(n, req);
     default:
-        assert(false);
+        g_assert_not_reached();
     }
 
     return NVME_INVALID_OPCODE | NVME_DNR;
@@ -7205,7 +7205,7 @@ static uint16_t nvme_admin_cmd(NvmeCtrl *n, NvmeRequest *req)
     case NVME_ADM_CMD_DIRECTIVE_RECV:
         return nvme_directive_receive(n, req);
     default:
-        assert(false);
+        g_assert_not_reached();
     }
 
     return NVME_INVALID_OPCODE | NVME_DNR;
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 19/44] hw/pci: replace assert(false) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (17 preceding siblings ...)
  2024-09-25 11:09 ` [PULL 18/44] hw/nvme: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 20/44] hw/ppc: " Thomas Huth
                   ` (26 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-12-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/pci/pci-stub.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c
index f0508682d2..c6950e21bd 100644
--- a/hw/pci/pci-stub.c
+++ b/hw/pci/pci-stub.c
@@ -46,13 +46,13 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict)
 /* kvm-all wants this */
 MSIMessage pci_get_msi_message(PCIDevice *dev, int vector)
 {
-    g_assert(false);
+    g_assert_not_reached();
     return (MSIMessage){};
 }
 
 uint16_t pci_requester_id(PCIDevice *dev)
 {
-    g_assert(false);
+    g_assert_not_reached();
     return 0;
 }
 
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 20/44] hw/ppc: replace assert(false) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (18 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 19/44] hw/pci: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 21/44] migration: " Thomas Huth
                   ` (25 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-13-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/ppc/spapr_events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index cb0eeee587..38ac1cb786 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -645,7 +645,7 @@ static void spapr_hotplug_req_event(uint8_t hp_id, uint8_t hp_action,
         /* we shouldn't be signaling hotplug events for resources
          * that don't support them
          */
-        g_assert(false);
+        g_assert_not_reached();
         return;
     }
 
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 21/44] migration: replace assert(false) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (19 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 20/44] hw/ppc: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 22/44] target/i386/kvm: " Thomas Huth
                   ` (24 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-14-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 migration/dirtyrate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
index 1d9db81299..c03b13b624 100644
--- a/migration/dirtyrate.c
+++ b/migration/dirtyrate.c
@@ -228,7 +228,7 @@ static int time_unit_to_power(TimeUnit time_unit)
     case TIME_UNIT_MILLISECOND:
         return -3;
     default:
-        assert(false); /* unreachable */
+        g_assert_not_reached();
         return 0;
     }
 }
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 22/44] target/i386/kvm: replace assert(false) with g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (20 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 21/44] migration: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 23/44] accel/tcg: remove break after g_assert_not_reached() Thomas Huth
                   ` (23 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20240919044641.386068-15-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/i386/kvm/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index ada581c5d6..c8056ef83d 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -5771,7 +5771,7 @@ static int kvm_handle_rdmsr(X86CPU *cpu, struct kvm_run *run)
         }
     }
 
-    assert(false);
+    g_assert_not_reached();
 }
 
 static int kvm_handle_wrmsr(X86CPU *cpu, struct kvm_run *run)
@@ -5790,7 +5790,7 @@ static int kvm_handle_wrmsr(X86CPU *cpu, struct kvm_run *run)
         }
     }
 
-    assert(false);
+    g_assert_not_reached();
 }
 
 static bool has_sgx_provisioning;
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 23/44] accel/tcg: remove break after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (21 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 22/44] target/i386/kvm: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 24/44] block: " Thomas Huth
                   ` (22 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-16-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 accel/tcg/plugin-gen.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c
index ec89a085b4..2ee4c22bef 100644
--- a/accel/tcg/plugin-gen.c
+++ b/accel/tcg/plugin-gen.c
@@ -251,7 +251,6 @@ static void inject_mem_cb(struct qemu_plugin_dyn_cb *cb,
         break;
     default:
         g_assert_not_reached();
-        break;
     }
 }
 
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 24/44] block: remove break after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (22 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 23/44] accel/tcg: remove break after g_assert_not_reached() Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 25/44] hw/acpi: " Thomas Huth
                   ` (21 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-17-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 block/ssh.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/ssh.c b/block/ssh.c
index 27d582e0e3..871e1d4753 100644
--- a/block/ssh.c
+++ b/block/ssh.c
@@ -474,7 +474,6 @@ static int check_host_key(BDRVSSHState *s, SshHostKeyCheck *hkc, Error **errp)
                                        errp);
         }
         g_assert_not_reached();
-        break;
     case SSH_HOST_KEY_CHECK_MODE_KNOWN_HOSTS:
         return check_host_key_knownhosts(s, errp);
     default:
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 25/44] hw/acpi: remove break after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (23 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 24/44] block: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 26/44] hw/net: " Thomas Huth
                   ` (20 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-18-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/acpi/aml-build.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index 006c506a37..34e0ddbde8 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -535,7 +535,6 @@ void aml_append(Aml *parent_ctx, Aml *child)
         break;
     default:
         g_assert_not_reached();
-        break;
     }
     build_append_array(parent_ctx->buf, buf);
     build_free_array(buf);
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 26/44] hw/net: remove break after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (24 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 25/44] hw/acpi: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 27/44] hw/scsi: " Thomas Huth
                   ` (19 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-19-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/net/net_rx_pkt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c
index 6b9c4c9559..0ea8734474 100644
--- a/hw/net/net_rx_pkt.c
+++ b/hw/net/net_rx_pkt.c
@@ -376,7 +376,6 @@ net_rx_pkt_calc_rss_hash(struct NetRxPkt *pkt,
         break;
     default:
         g_assert_not_reached();
-        break;
     }
 
     net_toeplitz_key_init(&key_data, key);
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 27/44] hw/scsi: remove break after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (25 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 26/44] hw/net: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 28/44] hw/tpm: " Thomas Huth
                   ` (18 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-20-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/scsi/virtio-scsi.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 9f02ceea09..6637cfeaf5 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -357,7 +357,6 @@ static void virtio_scsi_do_one_tmf_bh(VirtIOSCSIReq *req)
 
     default:
         g_assert_not_reached();
-        break;
     }
 
 out:
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 28/44] hw/tpm: remove break after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (26 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 27/44] hw/scsi: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 29/44] target/arm: " Thomas Huth
                   ` (17 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-21-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/tpm/tpm_spapr.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/tpm/tpm_spapr.c b/hw/tpm/tpm_spapr.c
index e084e987e6..5f7a0dfc61 100644
--- a/hw/tpm/tpm_spapr.c
+++ b/hw/tpm/tpm_spapr.c
@@ -206,7 +206,6 @@ static int tpm_spapr_do_crq(struct SpaprVioDevice *dev, uint8_t *crq_data)
                 break;
             default:
                 g_assert_not_reached();
-                break;
             }
             trace_tpm_spapr_do_crq_get_version(be32_to_cpu(local_crq.data));
             spapr_tpm_send_crq(dev, &local_crq);
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 29/44] target/arm: remove break after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (27 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 28/44] hw/tpm: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 30/44] target/riscv: " Thomas Huth
                   ` (16 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-22-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/arm/hyp_gdbstub.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/arm/hyp_gdbstub.c b/target/arm/hyp_gdbstub.c
index f120d55caa..1e861263b3 100644
--- a/target/arm/hyp_gdbstub.c
+++ b/target/arm/hyp_gdbstub.c
@@ -158,7 +158,6 @@ int insert_hw_watchpoint(target_ulong addr, target_ulong len, int type)
         break;
     default:
         g_assert_not_reached();
-        break;
     }
     if (len <= 8) {
         /* we align the address and set the bits in BAS */
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 30/44] target/riscv: remove break after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (28 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 29/44] target/arm: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 31/44] fpu: " Thomas Huth
                   ` (15 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-23-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/riscv/monitor.c                  | 1 -
 target/riscv/insn_trans/trans_rvv.c.inc | 2 --
 2 files changed, 3 deletions(-)

diff --git a/target/riscv/monitor.c b/target/riscv/monitor.c
index f5b1ffe6c3..100005ea4e 100644
--- a/target/riscv/monitor.c
+++ b/target/riscv/monitor.c
@@ -184,7 +184,6 @@ static void mem_info_svxx(Monitor *mon, CPUArchState *env)
         break;
     default:
         g_assert_not_reached();
-        break;
     }
 
     /* calculate virtual address bits */
diff --git a/target/riscv/insn_trans/trans_rvv.c.inc b/target/riscv/insn_trans/trans_rvv.c.inc
index 3a3896ba06..f8928c44a8 100644
--- a/target/riscv/insn_trans/trans_rvv.c.inc
+++ b/target/riscv/insn_trans/trans_rvv.c.inc
@@ -3172,7 +3172,6 @@ static void load_element(TCGv_i64 dest, TCGv_ptr base,
         break;
     default:
         g_assert_not_reached();
-        break;
     }
 }
 
@@ -3257,7 +3256,6 @@ static void store_element(TCGv_i64 val, TCGv_ptr base,
         break;
     default:
         g_assert_not_reached();
-        break;
     }
 }
 
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 31/44] fpu: remove break after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (29 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 30/44] target/riscv: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 32/44] tcg/loongarch64: " Thomas Huth
                   ` (14 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-24-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 fpu/softfloat-parts.c.inc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc
index a44649f4f4..cc6e06b976 100644
--- a/fpu/softfloat-parts.c.inc
+++ b/fpu/softfloat-parts.c.inc
@@ -1373,7 +1373,6 @@ static FloatPartsN *partsN(minmax)(FloatPartsN *a, FloatPartsN *b,
             break;
         default:
             g_assert_not_reached();
-            break;
         }
         switch (b->cls) {
         case float_class_normal:
@@ -1386,7 +1385,6 @@ static FloatPartsN *partsN(minmax)(FloatPartsN *a, FloatPartsN *b,
             break;
         default:
             g_assert_not_reached();
-            break;
         }
     }
 
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 32/44] tcg/loongarch64: remove break after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (30 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 31/44] fpu: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 33/44] include/qemu: remove return " Thomas Huth
                   ` (13 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-25-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tcg/loongarch64/tcg-target.c.inc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
index 5b7ed5c176..973601aec3 100644
--- a/tcg/loongarch64/tcg-target.c.inc
+++ b/tcg/loongarch64/tcg-target.c.inc
@@ -650,7 +650,6 @@ static int tcg_out_setcond_int(TCGContext *s, TCGCond cond, TCGReg ret,
 
     default:
         g_assert_not_reached();
-        break;
     }
 
     return ret | flags;
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 33/44] include/qemu: remove return after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (31 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 32/44] tcg/loongarch64: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 34/44] hw/hyperv: " Thomas Huth
                   ` (12 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-26-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 include/qemu/pmem.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/include/qemu/pmem.h b/include/qemu/pmem.h
index d2d7ad085c..e12a67ba2c 100644
--- a/include/qemu/pmem.h
+++ b/include/qemu/pmem.h
@@ -22,7 +22,6 @@ pmem_memcpy_persist(void *pmemdest, const void *src, size_t len)
     /* If 'pmem' option is 'on', we should always have libpmem support,
        or qemu will report a error and exit, never come here. */
     g_assert_not_reached();
-    return NULL;
 }
 
 static inline void
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 34/44] hw/hyperv: remove return after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (32 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 33/44] include/qemu: remove return " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 35/44] hw/net: " Thomas Huth
                   ` (11 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-27-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/hyperv/hyperv_testdev.c | 1 -
 hw/hyperv/vmbus.c          | 3 ---
 2 files changed, 4 deletions(-)

diff --git a/hw/hyperv/hyperv_testdev.c b/hw/hyperv/hyperv_testdev.c
index ef50e490c4..a630ca7047 100644
--- a/hw/hyperv/hyperv_testdev.c
+++ b/hw/hyperv/hyperv_testdev.c
@@ -89,7 +89,6 @@ static TestSintRoute *sint_route_find(HypervTestDev *dev,
         }
     }
     g_assert_not_reached();
-    return NULL;
 }
 
 static void sint_route_destroy(HypervTestDev *dev,
diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c
index 03f415bf22..b36bd3d67d 100644
--- a/hw/hyperv/vmbus.c
+++ b/hw/hyperv/vmbus.c
@@ -1890,7 +1890,6 @@ static bool complete_create_gpadl(VMBus *vmbus)
     }
 
     g_assert_not_reached();
-    return false;
 }
 
 static void handle_gpadl_teardown(VMBus *vmbus,
@@ -1947,7 +1946,6 @@ static bool complete_teardown_gpadl(VMBus *vmbus)
     }
 
     g_assert_not_reached();
-    return false;
 }
 
 static void handle_open_channel(VMBus *vmbus, vmbus_message_open_channel *msg,
@@ -2021,7 +2019,6 @@ static bool complete_open_channel(VMBus *vmbus)
     }
 
     g_assert_not_reached();
-    return false;
 }
 
 static void vdev_reset_on_close(VMBusDevice *vdev)
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 35/44] hw/net: remove return after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (33 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 34/44] hw/hyperv: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 36/44] hw/pci: " Thomas Huth
                   ` (10 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-28-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/net/e1000e_core.c | 2 --
 hw/net/igb_core.c    | 2 --
 hw/net/vmxnet3.c     | 1 -
 3 files changed, 5 deletions(-)

diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index 248381f976..2e4c50ddba 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -562,7 +562,6 @@ e1000e_rss_calc_hash(E1000ECore *core,
         break;
     default:
         g_assert_not_reached();
-        return 0;
     }
 
     return net_rx_pkt_calc_rss_hash(pkt, type, (uint8_t *) &core->mac[RSSRK]);
@@ -841,7 +840,6 @@ e1000e_ring_free_descr_num(E1000ECore *core, const E1000ERingInfo *r)
     }
 
     g_assert_not_reached();
-    return 0;
 }
 
 static inline bool
diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c
index 6be6140771..5dffa12c64 100644
--- a/hw/net/igb_core.c
+++ b/hw/net/igb_core.c
@@ -398,7 +398,6 @@ igb_rss_calc_hash(IGBCore *core, struct NetRxPkt *pkt, E1000E_RSSInfo *info)
         break;
     default:
         g_assert_not_reached();
-        return 0;
     }
 
     return net_rx_pkt_calc_rss_hash(pkt, type, (uint8_t *) &core->mac[RSSRK]);
@@ -747,7 +746,6 @@ igb_ring_free_descr_num(IGBCore *core, const E1000ERingInfo *r)
     }
 
     g_assert_not_reached();
-    return 0;
 }
 
 static inline bool
diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c
index bb8583c7ab..8aa8c46228 100644
--- a/hw/net/vmxnet3.c
+++ b/hw/net/vmxnet3.c
@@ -456,7 +456,6 @@ vmxnet3_setup_tx_offloads(VMXNET3State *s)
 
     default:
         g_assert_not_reached();
-        return false;
     }
 
     return true;
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 36/44] hw/pci: remove return after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (34 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 35/44] hw/net: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 37/44] hw/ppc: " Thomas Huth
                   ` (9 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-29-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/pci/pci-stub.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c
index c6950e21bd..3397d0c82e 100644
--- a/hw/pci/pci-stub.c
+++ b/hw/pci/pci-stub.c
@@ -47,13 +47,11 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict *qdict)
 MSIMessage pci_get_msi_message(PCIDevice *dev, int vector)
 {
     g_assert_not_reached();
-    return (MSIMessage){};
 }
 
 uint16_t pci_requester_id(PCIDevice *dev)
 {
     g_assert_not_reached();
-    return 0;
 }
 
 /* Required by ahci.c */
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 37/44] hw/ppc: remove return after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (35 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 36/44] hw/pci: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 38/44] migration: " Thomas Huth
                   ` (8 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-30-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 hw/ppc/ppc.c          | 1 -
 hw/ppc/spapr_events.c | 1 -
 2 files changed, 2 deletions(-)

diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c
index e6fa5580c0..fde4619412 100644
--- a/hw/ppc/ppc.c
+++ b/hw/ppc/ppc.c
@@ -267,7 +267,6 @@ static void power9_set_irq(void *opaque, int pin, int level)
         break;
     default:
         g_assert_not_reached();
-        return;
     }
 }
 
diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index 38ac1cb786..4dbf8e2e2e 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -646,7 +646,6 @@ static void spapr_hotplug_req_event(uint8_t hp_id, uint8_t hp_action,
          * that don't support them
          */
         g_assert_not_reached();
-        return;
     }
 
     if (hp_id == RTAS_LOG_V6_HP_ID_DRC_COUNT) {
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 38/44] migration: remove return after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (36 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 37/44] hw/ppc: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 39/44] qobject: " Thomas Huth
                   ` (7 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240919044641.386068-31-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 migration/dirtyrate.c    | 1 -
 migration/postcopy-ram.c | 7 -------
 migration/ram.c          | 2 --
 3 files changed, 10 deletions(-)

diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
index c03b13b624..5478d58de3 100644
--- a/migration/dirtyrate.c
+++ b/migration/dirtyrate.c
@@ -229,7 +229,6 @@ static int time_unit_to_power(TimeUnit time_unit)
         return -3;
     default:
         g_assert_not_reached();
-        return 0;
     }
 }
 
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index f431bbc0d4..0fe9d83d44 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -1412,40 +1412,34 @@ int postcopy_ram_incoming_init(MigrationIncomingState *mis)
 int postcopy_ram_incoming_cleanup(MigrationIncomingState *mis)
 {
     g_assert_not_reached();
-    return -1;
 }
 
 int postcopy_ram_prepare_discard(MigrationIncomingState *mis)
 {
     g_assert_not_reached();
-    return -1;
 }
 
 int postcopy_request_shared_page(struct PostCopyFD *pcfd, RAMBlock *rb,
                                  uint64_t client_addr, uint64_t rb_offset)
 {
     g_assert_not_reached();
-    return -1;
 }
 
 int postcopy_ram_incoming_setup(MigrationIncomingState *mis)
 {
     g_assert_not_reached();
-    return -1;
 }
 
 int postcopy_place_page(MigrationIncomingState *mis, void *host, void *from,
                         RAMBlock *rb)
 {
     g_assert_not_reached();
-    return -1;
 }
 
 int postcopy_place_page_zero(MigrationIncomingState *mis, void *host,
                         RAMBlock *rb)
 {
     g_assert_not_reached();
-    return -1;
 }
 
 int postcopy_wake_shared(struct PostCopyFD *pcfd,
@@ -1453,7 +1447,6 @@ int postcopy_wake_shared(struct PostCopyFD *pcfd,
                          RAMBlock *rb)
 {
     g_assert_not_reached();
-    return -1;
 }
 #endif
 
diff --git a/migration/ram.c b/migration/ram.c
index 0aa5d34743..81eda2736a 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -1766,13 +1766,11 @@ bool ram_write_tracking_available(void)
 bool ram_write_tracking_compatible(void)
 {
     g_assert_not_reached();
-    return false;
 }
 
 int ram_write_tracking_start(void)
 {
     g_assert_not_reached();
-    return -1;
 }
 
 void ram_write_tracking_stop(void)
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 39/44] qobject: remove return after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (37 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 38/44] migration: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 40/44] qom: " Thomas Huth
                   ` (6 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-32-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 qobject/qnum.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/qobject/qnum.c b/qobject/qnum.c
index 2138b563a9..dd8ea49565 100644
--- a/qobject/qnum.c
+++ b/qobject/qnum.c
@@ -86,7 +86,6 @@ bool qnum_get_try_int(const QNum *qn, int64_t *val)
     }
 
     g_assert_not_reached();
-    return false;
 }
 
 /**
@@ -124,7 +123,6 @@ bool qnum_get_try_uint(const QNum *qn, uint64_t *val)
     }
 
     g_assert_not_reached();
-    return false;
 }
 
 /**
@@ -157,7 +155,6 @@ double qnum_get_double(QNum *qn)
     }
 
     g_assert_not_reached();
-    return 0.0;
 }
 
 char *qnum_to_string(QNum *qn)
@@ -173,7 +170,6 @@ char *qnum_to_string(QNum *qn)
     }
 
     g_assert_not_reached();
-    return NULL;
 }
 
 /**
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 40/44] qom: remove return after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (38 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 39/44] qobject: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 41/44] tests/qtest: " Thomas Huth
                   ` (5 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-33-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 qom/object.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/qom/object.c b/qom/object.c
index 157a45c5f8..28c5b66eab 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -2079,7 +2079,6 @@ const char *object_get_canonical_path_component(const Object *obj)
 
     /* obj had a parent but was not a child, should never happen */
     g_assert_not_reached();
-    return NULL;
 }
 
 char *object_get_canonical_path(const Object *obj)
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 41/44] tests/qtest: remove return after g_assert_not_reached()
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (39 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 40/44] qom: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 42/44] scripts/checkpatch.pl: emit error when using assert(false) Thomas Huth
                   ` (4 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-34-pierrick.bouvier@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 tests/qtest/acpi-utils.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/qtest/acpi-utils.c b/tests/qtest/acpi-utils.c
index 673fc97586..9dc24fbe5a 100644
--- a/tests/qtest/acpi-utils.c
+++ b/tests/qtest/acpi-utils.c
@@ -156,5 +156,4 @@ uint64_t acpi_find_rsdp_address_uefi(QTestState *qts, uint64_t start,
         g_usleep(TEST_DELAY);
     }
     g_assert_not_reached();
-    return 0;
 }
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 42/44] scripts/checkpatch.pl: emit error when using assert(false)
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (40 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 41/44] tests/qtest: " Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 43/44] .gitlab-ci.d: Split build and test in cross build job templates Thomas Huth
                   ` (3 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Pierrick Bouvier <pierrick.bouvier@linaro.org>

This patch is part of a series that moves towards a consistent use of
g_assert_not_reached() rather than an ad hoc mix of different
assertion mechanisms.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-ID: <20240919044641.386068-35-pierrick.bouvier@linaro.org>
[thuth: Split long line to avoid checkpatch error]
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 scripts/checkpatch.pl | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 65b6f46f90..1b21249c91 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3102,6 +3102,10 @@ sub process {
 		if ($line =~ /\b(g_)?assert\(0\)/) {
 			ERROR("use g_assert_not_reached() instead of assert(0)\n" . $herecurr);
 		}
+		if ($line =~ /\b(g_)?assert\(false\)/) {
+			ERROR("use g_assert_not_reached() instead of assert(false)\n" .
+			      $herecurr);
+		}
 		if ($line =~ /\bstrerrorname_np\(/) {
 			ERROR("use strerror() instead of strerrorname_np()\n" . $herecurr);
 		}
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 43/44] .gitlab-ci.d: Split build and test in cross build job templates
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (41 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 42/44] scripts/checkpatch.pl: emit error when using assert(false) Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 11:10 ` [PULL 44/44] .gitlab-ci.d: Make separate collapsible log sections for build and test Thomas Huth
                   ` (2 subsequent siblings)
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Peter Maydell <peter.maydell@linaro.org>

In the native_build_job_template we have separate steps in the script
for the build and the test steps.  This is helpful because then
gitlab will give separate timestamps in the log view for each, and
you can see how long it took to compile vs how long to test.  In the
templates in crossbuild-template.yml, however, we do both the build
and test in a single 'make' invocation, and so we don't get the
separate timing information.

Split the build and test, in the same way we do in the native build
template.

This will also give us a place to separate out how parallel we want
to do the build by default from how parallel we want to do the tests
by default, which might be helpful in future.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240918125449.3125571-2-peter.maydell@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.d/crossbuild-template.yml | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
index 2ce0432eb7..d1cb7a35db 100644
--- a/.gitlab-ci.d/crossbuild-template.yml
+++ b/.gitlab-ci.d/crossbuild-template.yml
@@ -9,6 +9,7 @@
     when: always
   timeout: 80m
   before_script:
+    - JOBS=$(expr $(nproc) + 1)
     - cat /packages.txt
   script:
     - export CCACHE_BASEDIR="$(pwd)"
@@ -24,7 +25,11 @@
           i386-softmmu microblaze-softmmu mips-softmmu mipsel-softmmu
           mips64-softmmu ppc-softmmu riscv32-softmmu sh4-softmmu
           sparc-softmmu xtensa-softmmu $CROSS_SKIP_TARGETS"
-    - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
+    - make -j"$JOBS" all check-build
+    - if test -n "$MAKE_CHECK_ARGS";
+      then
+        $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
+      fi
     - if grep -q "EXESUF=.exe" config-host.mak;
       then make installer;
       version="$(git describe --match v[0-9]* 2>/dev/null || git rev-parse --short HEAD)";
@@ -46,6 +51,8 @@
     paths:
       - ccache/
     key: "$CI_JOB_NAME"
+  before_script:
+    - JOBS=$(expr $(nproc) + 1)
   script:
     - export CCACHE_BASEDIR="$(pwd)"
     - export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
@@ -55,7 +62,11 @@
     - cd build
     - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS
         --disable-tools --enable-${ACCEL:-kvm} $EXTRA_CONFIGURE_OPTS
-    - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
+    - make -j"$JOBS" all check-build
+    - if test -n "$MAKE_CHECK_ARGS";
+      then
+        $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
+      fi
 
 .cross_user_build_job:
   extends: .base_job_template
@@ -65,6 +76,8 @@
     paths:
       - ccache/
     key: "$CI_JOB_NAME"
+  before_script:
+    - JOBS=$(expr $(nproc) + 1)
   script:
     - export CCACHE_BASEDIR="$(pwd)"
     - export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
@@ -76,7 +89,11 @@
           alpha-linux-user m68k-linux-user microblazeel-linux-user
           or1k-linux-user ppc-linux-user sparc-linux-user
           xtensa-linux-user $CROSS_SKIP_TARGETS"
-    - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
+    - make -j"$JOBS" all check-build
+    - if test -n "$MAKE_CHECK_ARGS";
+      then
+        $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
+      fi
 
 # We can still run some tests on some of our cross build jobs. They can add this
 # template to their extends to save the build logs and test results
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* [PULL 44/44] .gitlab-ci.d: Make separate collapsible log sections for build and test
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (42 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 43/44] .gitlab-ci.d: Split build and test in cross build job templates Thomas Huth
@ 2024-09-25 11:10 ` Thomas Huth
  2024-09-25 17:24 ` [PULL 00/44] Functional test conversion, and assert(0) cleanup Pierrick Bouvier
  2024-09-28 13:37 ` Peter Maydell
  45 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-25 11:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Pierrick Bouvier

From: Peter Maydell <peter.maydell@linaro.org>

GitLab lets a CI job create its own collapsible log sections by
emitting special escape codes, as documented here:

https://docs.gitlab.com/ee/ci/yaml/script.html#expand-and-collapse-job-log-sections

Use these to make "configure", "build" and "test" separate
collapsible stages.

As recommended by the GitLab docs, we use some shell which is
sourced in the CI job to define functions to emit the magic
lines that start and end sections, to hide the ugliness of
the printf lines from the log.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240918125449.3125571-3-peter.maydell@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 .gitlab-ci.d/buildtest-template.yml  | 14 ++++++++++++++
 .gitlab-ci.d/buildtest.yml           |  1 +
 .gitlab-ci.d/crossbuild-template.yml | 25 ++++++++++++++++++++++++
 scripts/ci/gitlab-ci-section         | 29 ++++++++++++++++++++++++++++
 4 files changed, 69 insertions(+)
 create mode 100644 scripts/ci/gitlab-ci-section

diff --git a/.gitlab-ci.d/buildtest-template.yml b/.gitlab-ci.d/buildtest-template.yml
index 5f2fc7e6f4..8c69c60d21 100644
--- a/.gitlab-ci.d/buildtest-template.yml
+++ b/.gitlab-ci.d/buildtest-template.yml
@@ -8,8 +8,11 @@
     key: "$CI_JOB_NAME"
     when: always
   before_script:
+    - source scripts/ci/gitlab-ci-section
+    - section_start setup "Pre-script setup"
     - JOBS=$(expr $(nproc) + 1)
     - cat /packages.txt
+    - section_end setup
   script:
     - export CCACHE_BASEDIR="$(pwd)"
     - export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
@@ -19,6 +22,7 @@
     - mkdir build
     - cd build
     - ccache --zero-stats
+    - section_start configure "Running configure"
     - ../configure --enable-werror --disable-docs --enable-fdt=system
           ${TARGETS:+--target-list="$TARGETS"}
           $CONFIGURE_ARGS ||
@@ -27,11 +31,16 @@
       then
         pyvenv/bin/meson configure . -Dbackend_max_links="$LD_JOBS" ;
       fi || exit 1;
+    - section_end configure
+    - section_start build "Building QEMU"
     - $MAKE -j"$JOBS"
+    - section_end build
+    - section_start test "Running tests"
     - if test -n "$MAKE_CHECK_ARGS";
       then
         $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
       fi
+    - section_end test
     - ccache --show-stats
 
 # We jump some hoops in common_test_job_template to avoid
@@ -54,6 +63,8 @@
   stage: test
   image: $CI_REGISTRY_IMAGE/qemu/$IMAGE:$QEMU_CI_CONTAINER_TAG
   script:
+    - source scripts/ci/gitlab-ci-section
+    - section_start buildenv "Setting up to run tests"
     - scripts/git-submodule.sh update roms/SLOF
     - meson subprojects download $(cd build/subprojects && echo *)
     - cd build
@@ -63,7 +74,10 @@
     - if [ "x${QEMU_TEST_CACHE_DIR}" != "x" ]; then
         $MAKE precache-functional ;
       fi
+    - section_end buildenv
+    - section_start test "Running tests"
     - $MAKE NINJA=":" $MAKE_CHECK_ARGS
+    - section_end test
 
 .native_test_job_template:
   extends: .common_test_job_template
diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml
index 2ab8c4806e..87848c2ffe 100644
--- a/.gitlab-ci.d/buildtest.yml
+++ b/.gitlab-ci.d/buildtest.yml
@@ -188,6 +188,7 @@ build-previous-qemu:
     # Override the default flags as we need more to grab the old version
     GIT_FETCH_EXTRA_FLAGS: --prune --quiet
   before_script:
+    - source scripts/ci/gitlab-ci-section
     - export QEMU_PREV_VERSION="$(sed 's/\([0-9.]*\)\.[0-9]*/v\1.0/' VERSION)"
     - git remote add upstream https://gitlab.com/qemu-project/qemu
     - git fetch upstream refs/tags/$QEMU_PREV_VERSION:refs/tags/$QEMU_PREV_VERSION
diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml
index d1cb7a35db..45a9810355 100644
--- a/.gitlab-ci.d/crossbuild-template.yml
+++ b/.gitlab-ci.d/crossbuild-template.yml
@@ -9,8 +9,11 @@
     when: always
   timeout: 80m
   before_script:
+    - source scripts/ci/gitlab-ci-section
+    - section_start setup "Pre-script setup"
     - JOBS=$(expr $(nproc) + 1)
     - cat /packages.txt
+    - section_end setup
   script:
     - export CCACHE_BASEDIR="$(pwd)"
     - export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
@@ -19,22 +22,30 @@
     - mkdir build
     - cd build
     - ccache --zero-stats
+    - section_start configure "Running configure"
     - ../configure --enable-werror --disable-docs --enable-fdt=system
         --disable-user $QEMU_CONFIGURE_OPTS $EXTRA_CONFIGURE_OPTS
         --target-list-exclude="arm-softmmu
           i386-softmmu microblaze-softmmu mips-softmmu mipsel-softmmu
           mips64-softmmu ppc-softmmu riscv32-softmmu sh4-softmmu
           sparc-softmmu xtensa-softmmu $CROSS_SKIP_TARGETS"
+    - section_end configure
+    - section_start build "Building QEMU"
     - make -j"$JOBS" all check-build
+    - section_end build
+    - section_start test "Running tests"
     - if test -n "$MAKE_CHECK_ARGS";
       then
         $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
       fi
+    - section_end test
+    - section_start installer "Building the installer"
     - if grep -q "EXESUF=.exe" config-host.mak;
       then make installer;
       version="$(git describe --match v[0-9]* 2>/dev/null || git rev-parse --short HEAD)";
       mv -v qemu-setup*.exe qemu-setup-${version}.exe;
       fi
+    - section_end installer
     - ccache --show-stats
 
 # Job to cross-build specific accelerators.
@@ -52,6 +63,7 @@
       - ccache/
     key: "$CI_JOB_NAME"
   before_script:
+    - source scripts/ci/gitlab-ci-section
     - JOBS=$(expr $(nproc) + 1)
   script:
     - export CCACHE_BASEDIR="$(pwd)"
@@ -60,13 +72,19 @@
     - export PATH="$CCACHE_WRAPPERSDIR:$PATH"
     - mkdir build
     - cd build
+    - section_start configure "Running configure"
     - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS
         --disable-tools --enable-${ACCEL:-kvm} $EXTRA_CONFIGURE_OPTS
+    - section_end configure
+    - section_start build "Building QEMU"
     - make -j"$JOBS" all check-build
+    - section_end build
+    - section_start test "Running tests"
     - if test -n "$MAKE_CHECK_ARGS";
       then
         $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
       fi
+    - section_end test
 
 .cross_user_build_job:
   extends: .base_job_template
@@ -77,6 +95,7 @@
       - ccache/
     key: "$CI_JOB_NAME"
   before_script:
+    - source scripts/ci/gitlab-ci-section
     - JOBS=$(expr $(nproc) + 1)
   script:
     - export CCACHE_BASEDIR="$(pwd)"
@@ -84,16 +103,22 @@
     - export CCACHE_MAXSIZE="500M"
     - mkdir build
     - cd build
+    - section_start configure "Running configure"
     - ../configure --enable-werror --disable-docs $QEMU_CONFIGURE_OPTS
         --disable-system --target-list-exclude="aarch64_be-linux-user
           alpha-linux-user m68k-linux-user microblazeel-linux-user
           or1k-linux-user ppc-linux-user sparc-linux-user
           xtensa-linux-user $CROSS_SKIP_TARGETS"
+    - section_end configure
+    - section_start build "Building QEMU"
     - make -j"$JOBS" all check-build
+    - section_end build
+    - section_start test "Running tests"
     - if test -n "$MAKE_CHECK_ARGS";
       then
         $MAKE -j"$JOBS" $MAKE_CHECK_ARGS ;
       fi
+    - section_end test
 
 # We can still run some tests on some of our cross build jobs. They can add this
 # template to their extends to save the build logs and test results
diff --git a/scripts/ci/gitlab-ci-section b/scripts/ci/gitlab-ci-section
new file mode 100644
index 0000000000..9bbe80420d
--- /dev/null
+++ b/scripts/ci/gitlab-ci-section
@@ -0,0 +1,29 @@
+# Copyright (c) 2024 Linaro Ltd
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+# gitlab-ci-section: This is a shell script fragment which defines
+# functions section_start and section_end which will emit marker lines
+# that GitLab will interpret as the beginning or end of a "collapsible
+# section" in a CI job log. See
+# https://docs.gitlab.com/ee/ci/yaml/script.html#expand-and-collapse-job-log-sections
+#
+# This is intended to be sourced in the before_script section of
+# a CI config; the section_start and section_end functions will
+# then be available for use in the before_script and script sections.
+
+# Section names are [-_.A-Za-z0-9] and the section_start pairs with
+# a section_end with the same section name.
+# The description can be any printable text without newlines; this is
+# what will appear in the log.
+
+# Usage:
+# section_start section_name "Description of the section"
+section_start () {
+    printf "section_start:%s:%s\r\e[0K%s\n" "$(date +%s)" "$1" "$2"
+}
+
+# Usage:
+# section_end section_name
+section_end () {
+    printf "section_end:%s:%s\r\e[0K\n" "$(date +%s)" "$1"
+}
-- 
2.46.0



^ permalink raw reply related	[flat|nested] 49+ messages in thread

* Re: [PULL 00/44] Functional test conversion, and assert(0) cleanup
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (43 preceding siblings ...)
  2024-09-25 11:10 ` [PULL 44/44] .gitlab-ci.d: Make separate collapsible log sections for build and test Thomas Huth
@ 2024-09-25 17:24 ` Pierrick Bouvier
  2024-09-28 13:37 ` Peter Maydell
  45 siblings, 0 replies; 49+ messages in thread
From: Pierrick Bouvier @ 2024-09-25 17:24 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel; +Cc: Peter Maydell

On 9/25/24 04:09, Thomas Huth wrote:
> The following changes since commit 01dc65a3bc262ab1bec8fe89775e9bbfa627becb:
> 
>    Merge tag 'pull-target-arm-20240919' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-09-19 14:15:15 +0100)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/thuth/qemu.git tags/pull-request-2024-09-25
> 
> for you to fetch changes up to dc05b2628e3913e668590ba66d9c618382d351ae:
> 
>    .gitlab-ci.d: Make separate collapsible log sections for build and test (2024-09-25 09:42:06 +0200)
> 
> ----------------------------------------------------------------
> * Convert more Avocado tests to the new functional test framework
> * Clean up assert() statements, use g_assert_not_reached() when possible
> * Improve output of the gitlab CI jobs
> 
> ----------------------------------------------------------------
> Peter Maydell (2):
>        .gitlab-ci.d: Split build and test in cross build job templates
>        .gitlab-ci.d: Make separate collapsible log sections for build and test
> 
> Pierrick Bouvier (34):
>        hw/acpi: replace assert(0) with g_assert_not_reached()
>        hw/arm: replace assert(0) with g_assert_not_reached()
>        hw/net: replace assert(0) with g_assert_not_reached()
>        migration: replace assert(0) with g_assert_not_reached()
>        qobject: replace assert(0) with g_assert_not_reached()
>        target/ppc: replace assert(0) with g_assert_not_reached()
>        block: replace assert(false) with g_assert_not_reached()
>        hw/hyperv: replace assert(false) with g_assert_not_reached()
>        hw/net: replace assert(false) with g_assert_not_reached()
>        hw/nvme: replace assert(false) with g_assert_not_reached()
>        hw/pci: replace assert(false) with g_assert_not_reached()
>        hw/ppc: replace assert(false) with g_assert_not_reached()
>        migration: replace assert(false) with g_assert_not_reached()
>        target/i386/kvm: replace assert(false) with g_assert_not_reached()
>        accel/tcg: remove break after g_assert_not_reached()
>        block: remove break after g_assert_not_reached()
>        hw/acpi: remove break after g_assert_not_reached()
>        hw/net: remove break after g_assert_not_reached()
>        hw/scsi: remove break after g_assert_not_reached()
>        hw/tpm: remove break after g_assert_not_reached()
>        target/arm: remove break after g_assert_not_reached()
>        target/riscv: remove break after g_assert_not_reached()
>        fpu: remove break after g_assert_not_reached()
>        tcg/loongarch64: remove break after g_assert_not_reached()
>        include/qemu: remove return after g_assert_not_reached()
>        hw/hyperv: remove return after g_assert_not_reached()
>        hw/net: remove return after g_assert_not_reached()
>        hw/pci: remove return after g_assert_not_reached()
>        hw/ppc: remove return after g_assert_not_reached()
>        migration: remove return after g_assert_not_reached()
>        qobject: remove return after g_assert_not_reached()
>        qom: remove return after g_assert_not_reached()
>        tests/qtest: remove return after g_assert_not_reached()
>        scripts/checkpatch.pl: emit error when using assert(false)
> 
> Thomas Huth (8):
>        tests/functional/qemu_test: Add a function for launching kernels more easily
>        tests/functional: Convert the vexpressa9 Avocado test
>        tests/functional: Convert the xtensa lx60 Avocado test
>        tests/functional: Convert the SPARCStation Avocado test
>        tests/functional: Convert the e500 ppc64 Avocado test
>        tests/functional: Convert the mac ppc Avocado tests
>        tests/functional: Convert the r2d sh4 Avocado test
>        tests/functional: Convert the powernv tests from boot_linux_console.py
> 
>   MAINTAINERS                               |   7 ++
>   include/qemu/pmem.h                       |   1 -
>   accel/tcg/plugin-gen.c                    |   1 -
>   block/qcow2.c                             |   2 +-
>   block/ssh.c                               |   1 -
>   hw/acpi/aml-build.c                       |   3 +-
>   hw/arm/highbank.c                         |   2 +-
>   hw/hyperv/hyperv_testdev.c                |   7 +-
>   hw/hyperv/vmbus.c                         |  15 ++--
>   hw/net/e1000e_core.c                      |   4 +-
>   hw/net/i82596.c                           |   2 +-
>   hw/net/igb_core.c                         |   4 +-
>   hw/net/net_rx_pkt.c                       |   3 +-
>   hw/net/vmxnet3.c                          |   1 -
>   hw/nvme/ctrl.c                            |   8 +-
>   hw/pci/pci-stub.c                         |   6 +-
>   hw/ppc/ppc.c                              |   1 -
>   hw/ppc/spapr_events.c                     |   3 +-
>   hw/scsi/virtio-scsi.c                     |   1 -
>   hw/tpm/tpm_spapr.c                        |   1 -
>   migration/dirtyrate.c                     |   3 +-
>   migration/migration-hmp-cmds.c            |   2 +-
>   migration/postcopy-ram.c                  |  21 ++---
>   migration/ram.c                           |   8 +-
>   qobject/qlit.c                            |   2 +-
>   qobject/qnum.c                            |  12 +--
>   qom/object.c                              |   1 -
>   target/arm/hyp_gdbstub.c                  |   1 -
>   target/i386/kvm/kvm.c                     |   4 +-
>   target/ppc/dfp_helper.c                   |   8 +-
>   target/ppc/mmu_helper.c                   |   2 +-
>   target/riscv/monitor.c                    |   1 -
>   tests/qtest/acpi-utils.c                  |   1 -
>   fpu/softfloat-parts.c.inc                 |   2 -
>   target/riscv/insn_trans/trans_rvv.c.inc   |   2 -
>   tcg/loongarch64/tcg-target.c.inc          |   1 -
>   .gitlab-ci.d/buildtest-template.yml       |  14 +++
>   .gitlab-ci.d/buildtest.yml                |   1 +
>   .gitlab-ci.d/crossbuild-template.yml      |  48 ++++++++++-
>   scripts/checkpatch.pl                     |   4 +
>   scripts/ci/gitlab-ci-section              |  29 +++++++
>   tests/avocado/boot_linux_console.py       | 138 ------------------------------
>   tests/functional/meson.build              |  15 ++++
>   tests/functional/qemu_test/linuxkernel.py |  12 +++
>   tests/functional/test_arm_vexpress.py     |  26 ++++++
>   tests/functional/test_ppc64_e500.py       |  25 ++++++
>   tests/functional/test_ppc64_powernv.py    |  42 ++++++++-
>   tests/functional/test_ppc_mac.py          |  38 ++++++++
>   tests/functional/test_sh4_r2d.py          |  31 +++++++
>   tests/functional/test_sparc_sun4m.py      |  25 ++++++
>   tests/functional/test_xtensa_lx60.py      |  26 ++++++
>   51 files changed, 384 insertions(+), 234 deletions(-)
>   create mode 100644 scripts/ci/gitlab-ci-section
>   create mode 100755 tests/functional/test_arm_vexpress.py
>   create mode 100755 tests/functional/test_ppc64_e500.py
>   create mode 100755 tests/functional/test_ppc_mac.py
>   create mode 100755 tests/functional/test_sh4_r2d.py
>   create mode 100755 tests/functional/test_sparc_sun4m.py
>   create mode 100755 tests/functional/test_xtensa_lx60.py
> 

Thanks for pulling the assert cleanup series.


^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PULL 00/44] Functional test conversion, and assert(0) cleanup
  2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
                   ` (44 preceding siblings ...)
  2024-09-25 17:24 ` [PULL 00/44] Functional test conversion, and assert(0) cleanup Pierrick Bouvier
@ 2024-09-28 13:37 ` Peter Maydell
  45 siblings, 0 replies; 49+ messages in thread
From: Peter Maydell @ 2024-09-28 13:37 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel, Pierrick Bouvier

On Wed, 25 Sept 2024 at 12:10, Thomas Huth <thuth@redhat.com> wrote:
>
> The following changes since commit 01dc65a3bc262ab1bec8fe89775e9bbfa627becb:
>
>   Merge tag 'pull-target-arm-20240919' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-09-19 14:15:15 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/thuth/qemu.git tags/pull-request-2024-09-25
>
> for you to fetch changes up to dc05b2628e3913e668590ba66d9c618382d351ae:
>
>   .gitlab-ci.d: Make separate collapsible log sections for build and test (2024-09-25 09:42:06 +0200)
>
> ----------------------------------------------------------------
> * Convert more Avocado tests to the new functional test framework
> * Clean up assert() statements, use g_assert_not_reached() when possible
> * Improve output of the gitlab CI jobs
>


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/9.2
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PULL 02/44] tests/functional: Convert the vexpressa9 Avocado test
  2024-09-25 11:09 ` [PULL 02/44] tests/functional: Convert the vexpressa9 Avocado test Thomas Huth
@ 2024-09-30 16:47   ` Peter Maydell
  2024-09-30 17:21     ` Thomas Huth
  0 siblings, 1 reply; 49+ messages in thread
From: Peter Maydell @ 2024-09-30 16:47 UTC (permalink / raw)
  To: Thomas Huth; +Cc: qemu-devel, Pierrick Bouvier

On Wed, 25 Sept 2024 at 12:10, Thomas Huth <thuth@redhat.com> wrote:
>
> Use the new launch_kernel function to convert this test in a simple way.
>
> Message-ID: <20240919185749.71222-3-thuth@redhat.com>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  MAINTAINERS                           |  1 +
>  tests/avocado/boot_linux_console.py   |  9 ---------
>  tests/functional/meson.build          |  1 +
>  tests/functional/test_arm_vexpress.py | 26 ++++++++++++++++++++++++++
>  4 files changed, 28 insertions(+), 9 deletions(-)
>  create mode 100755 tests/functional/test_arm_vexpress.py

Hi. This sequence of patches changed us from
getting our CI images for the advent calendar tests
from URLs like
 https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/day16.tar.xz
to ones like
 https://www.qemu-advent-calendar.org/2018/download/day16.tar.xz

This new site has just stopped working: download
attempts return a 503. This breaks our CI:
https://gitlab.com/qemu-project/qemu/-/jobs/7955655569

Should we switch back?

thanks
-- PMM


^ permalink raw reply	[flat|nested] 49+ messages in thread

* Re: [PULL 02/44] tests/functional: Convert the vexpressa9 Avocado test
  2024-09-30 16:47   ` Peter Maydell
@ 2024-09-30 17:21     ` Thomas Huth
  0 siblings, 0 replies; 49+ messages in thread
From: Thomas Huth @ 2024-09-30 17:21 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, Pierrick Bouvier

On 30/09/2024 18.47, Peter Maydell wrote:
> On Wed, 25 Sept 2024 at 12:10, Thomas Huth <thuth@redhat.com> wrote:
>>
>> Use the new launch_kernel function to convert this test in a simple way.
>>
>> Message-ID: <20240919185749.71222-3-thuth@redhat.com>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>> ---
>>   MAINTAINERS                           |  1 +
>>   tests/avocado/boot_linux_console.py   |  9 ---------
>>   tests/functional/meson.build          |  1 +
>>   tests/functional/test_arm_vexpress.py | 26 ++++++++++++++++++++++++++
>>   4 files changed, 28 insertions(+), 9 deletions(-)
>>   create mode 100755 tests/functional/test_arm_vexpress.py
> 
> Hi. This sequence of patches changed us from
> getting our CI images for the advent calendar tests
> from URLs like
>   https://qemu-advcal.gitlab.io/qac-best-of-multiarch/download/day16.tar.xz
> to ones like
>   https://www.qemu-advent-calendar.org/2018/download/day16.tar.xz
> 
> This new site has just stopped working: download
> attempts return a 503. This breaks our CI:
> https://gitlab.com/qemu-project/qemu/-/jobs/7955655569
> 
> Should we switch back?

Yes, patch sent:

https://lore.kernel.org/qemu-devel/20240930171834.51701-1-thuth@redhat.com/

  Thomas



^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2024-09-30 17:22 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-25 11:09 [PULL 00/44] Functional test conversion, and assert(0) cleanup Thomas Huth
2024-09-25 11:09 ` [PULL 01/44] tests/functional/qemu_test: Add a function for launching kernels more easily Thomas Huth
2024-09-25 11:09 ` [PULL 02/44] tests/functional: Convert the vexpressa9 Avocado test Thomas Huth
2024-09-30 16:47   ` Peter Maydell
2024-09-30 17:21     ` Thomas Huth
2024-09-25 11:09 ` [PULL 03/44] tests/functional: Convert the xtensa lx60 " Thomas Huth
2024-09-25 11:09 ` [PULL 04/44] tests/functional: Convert the SPARCStation " Thomas Huth
2024-09-25 11:09 ` [PULL 05/44] tests/functional: Convert the e500 ppc64 " Thomas Huth
2024-09-25 11:09 ` [PULL 06/44] tests/functional: Convert the mac ppc Avocado tests Thomas Huth
2024-09-25 11:09 ` [PULL 07/44] tests/functional: Convert the r2d sh4 Avocado test Thomas Huth
2024-09-25 11:09 ` [PULL 08/44] tests/functional: Convert the powernv tests from boot_linux_console.py Thomas Huth
2024-09-25 11:09 ` [PULL 09/44] hw/acpi: replace assert(0) with g_assert_not_reached() Thomas Huth
2024-09-25 11:09 ` [PULL 10/44] hw/arm: " Thomas Huth
2024-09-25 11:09 ` [PULL 11/44] hw/net: " Thomas Huth
2024-09-25 11:09 ` [PULL 12/44] migration: " Thomas Huth
2024-09-25 11:09 ` [PULL 13/44] qobject: " Thomas Huth
2024-09-25 11:09 ` [PULL 14/44] target/ppc: " Thomas Huth
2024-09-25 11:09 ` [PULL 15/44] block: replace assert(false) " Thomas Huth
2024-09-25 11:09 ` [PULL 16/44] hw/hyperv: " Thomas Huth
2024-09-25 11:09 ` [PULL 17/44] hw/net: " Thomas Huth
2024-09-25 11:09 ` [PULL 18/44] hw/nvme: " Thomas Huth
2024-09-25 11:10 ` [PULL 19/44] hw/pci: " Thomas Huth
2024-09-25 11:10 ` [PULL 20/44] hw/ppc: " Thomas Huth
2024-09-25 11:10 ` [PULL 21/44] migration: " Thomas Huth
2024-09-25 11:10 ` [PULL 22/44] target/i386/kvm: " Thomas Huth
2024-09-25 11:10 ` [PULL 23/44] accel/tcg: remove break after g_assert_not_reached() Thomas Huth
2024-09-25 11:10 ` [PULL 24/44] block: " Thomas Huth
2024-09-25 11:10 ` [PULL 25/44] hw/acpi: " Thomas Huth
2024-09-25 11:10 ` [PULL 26/44] hw/net: " Thomas Huth
2024-09-25 11:10 ` [PULL 27/44] hw/scsi: " Thomas Huth
2024-09-25 11:10 ` [PULL 28/44] hw/tpm: " Thomas Huth
2024-09-25 11:10 ` [PULL 29/44] target/arm: " Thomas Huth
2024-09-25 11:10 ` [PULL 30/44] target/riscv: " Thomas Huth
2024-09-25 11:10 ` [PULL 31/44] fpu: " Thomas Huth
2024-09-25 11:10 ` [PULL 32/44] tcg/loongarch64: " Thomas Huth
2024-09-25 11:10 ` [PULL 33/44] include/qemu: remove return " Thomas Huth
2024-09-25 11:10 ` [PULL 34/44] hw/hyperv: " Thomas Huth
2024-09-25 11:10 ` [PULL 35/44] hw/net: " Thomas Huth
2024-09-25 11:10 ` [PULL 36/44] hw/pci: " Thomas Huth
2024-09-25 11:10 ` [PULL 37/44] hw/ppc: " Thomas Huth
2024-09-25 11:10 ` [PULL 38/44] migration: " Thomas Huth
2024-09-25 11:10 ` [PULL 39/44] qobject: " Thomas Huth
2024-09-25 11:10 ` [PULL 40/44] qom: " Thomas Huth
2024-09-25 11:10 ` [PULL 41/44] tests/qtest: " Thomas Huth
2024-09-25 11:10 ` [PULL 42/44] scripts/checkpatch.pl: emit error when using assert(false) Thomas Huth
2024-09-25 11:10 ` [PULL 43/44] .gitlab-ci.d: Split build and test in cross build job templates Thomas Huth
2024-09-25 11:10 ` [PULL 44/44] .gitlab-ci.d: Make separate collapsible log sections for build and test Thomas Huth
2024-09-25 17:24 ` [PULL 00/44] Functional test conversion, and assert(0) cleanup Pierrick Bouvier
2024-09-28 13:37 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).