Functional test conversion, and assert(0) cleanup
Subsystems (6)
[PULL 02/44] tests/functional: Convert the vexpressa9 Avocado test
In reply to Thomas HuthUse the new launch_kernel function to convert this test in a simple way.
Message-ID: <[email protected]>
--- 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
MAINTAINERS +1 -0
@@ -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 <[email protected]>
tests/avocado/boot_linux_console.py +0 -9
@@ -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
tests/functional/meson.build +1 -0
@@ -50,6 +50,7 @@ tests_arm_system_thorough = [ 'arm_canona1100', 'arm_integratorcp', 'arm_raspi2', + 'arm_vexpress', ] tests_arm_linuxuser_thorough = [
tests/functional/test_arm_vexpress.py new file +26 -0
@@ -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()
Signature · 1 line
2.46.0
[PULL 04/44] tests/functional: Convert the SPARCStation Avocado test
In reply to Thomas HuthUse the new launch_kernel function to convert this test in a simple way.
Message-ID: <[email protected]>
--- 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
MAINTAINERS +1 -0
@@ -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 <[email protected]>
tests/avocado/boot_linux_console.py +0 -8
@@ -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')
tests/functional/meson.build +4 -0
@@ -125,6 +125,10 @@ tests_s390x_system_thorough = [ 's390x_topology', ] +tests_sparc_system_thorough = [ + 'sparc_sun4m', +] + tests_sparc64_system_thorough = [ 'sparc64_sun4u', ]
tests/functional/test_sparc_sun4m.py new file +25 -0
@@ -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()
Signature · 1 line
2.46.0
[PULL 21/44] migration: replace assert(false) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- migration/dirtyrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
migration/dirtyrate.c +1 -1
@@ -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 ; } }
Signature · 1 line
2.46.0
[PULL 27/44] hw/scsi: remove break after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/scsi/virtio-scsi.c | 1 - 1 file changed, 1 deletion(-)
hw/scsi/virtio-scsi.c +0 -1
@@ -357,7 +357,6 @@ static void virtio_scsi_do_one_tmf_bh(VirtIOSCSIReq *req)default :g_assert_not_reached (); -break ; } out:
Signature · 1 line
2.46.0
[PULL 23/44] accel/tcg: remove break after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- accel/tcg/plugin-gen.c | 1 - 1 file changed, 1 deletion(-)
accel/tcg/plugin-gen.c +0 -1
@@ -251,7 +251,6 @@ static void inject_mem_cb(struct qemu_plugin_dyn_cb *cb,break ;default :g_assert_not_reached (); -break ; } }
Signature · 1 line
2.46.0
[PULL 25/44] hw/acpi: remove break after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/acpi/aml-build.c | 1 - 1 file changed, 1 deletion(-)
hw/acpi/aml-build.c +0 -1
@@ -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);
Signature · 1 line
2.46.0
[PULL 31/44] fpu: remove break after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- fpu/softfloat-parts.c.inc | 2 -- 1 file changed, 2 deletions(-)
fpu/softfloat-parts.c.inc +0 -2
@@ -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; } }
Signature · 1 line
2.46.0
[PULL 16/44] hw/hyperv: replace assert(false) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/hyperv/hyperv_testdev.c | 6 +++--- hw/hyperv/vmbus.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-)
hw/hyperv/hyperv_testdev.c +3 -3
@@ -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)
hw/hyperv/vmbus.c +6 -6
@@ -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; }
Signature · 1 line
2.46.0
[PULL 30/44] target/riscv: remove break after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- target/riscv/monitor.c | 1 - target/riscv/insn_trans/trans_rvv.c.inc | 2 -- 2 files changed, 3 deletions(-)
target/riscv/monitor.c +0 -1
@@ -184,7 +184,6 @@ static void mem_info_svxx(Monitor *mon, CPUArchState *env)break ;default :g_assert_not_reached (); -break ; }/* calculate virtual address bits */
target/riscv/insn_trans/trans_rvv.c.inc +0 -2
@@ -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; } }
Signature · 1 line
2.46.0
[PULL 08/44] tests/functional: Convert the powernv tests from boot_linux_console.py
In reply to Thomas HuthMove the tests into the already existing test_ppc64_powernv.py file.
Message-ID: <[email protected]>
--- tests/avocado/boot_linux_console.py | 46 -------------------------- tests/functional/test_ppc64_powernv.py | 42 +++++++++++++++++++++-- 2 files changed, 39 insertions(+), 49 deletions(-)
tests/avocado/boot_linux_console.py +0 -46
@@ -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')
tests/functional/test_ppc64_powernv.py +39 -3
54 lines not on this page · raw message
Signature · 1 line
2.46.0
[PULL 05/44] tests/functional: Convert the e500 ppc64 Avocado test
In reply to Thomas HuthUse the new launch_kernel function to convert this test in a simple way.
Message-ID: <[email protected]>
--- 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
MAINTAINERS +1 -0
@@ -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: [email protected]
tests/avocado/boot_linux_console.py +0 -11
@@ -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/')
tests/functional/meson.build +1 -0
@@ -111,6 +111,7 @@ tests_ppc_system_thorough = [ ] tests_ppc64_system_thorough = [ + 'ppc64_e500', 'ppc64_hv', 'ppc64_powernv', 'ppc64_pseries',
tests/functional/test_ppc64_e500.py new file +25 -0
@@ -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()
Signature · 1 line
2.46.0
[PULL 10/44] hw/arm: replace assert(0) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/arm/highbank.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/arm/highbank.c +1 -1
@@ -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++) {
Signature · 1 line
2.46.0
[PULL 36/44] hw/pci: remove return after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/pci/pci-stub.c | 2 -- 1 file changed, 2 deletions(-)
hw/pci/pci-stub.c +0 -2
@@ -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 */
Signature · 1 line
2.46.0
[PULL 15/44] block: replace assert(false) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/qcow2.c +1 -1
@@ -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) {
Signature · 1 line
2.46.0
[PULL 18/44] hw/nvme: replace assert(false) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/nvme/ctrl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
hw/nvme/ctrl.c +4 -4
@@ -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 ;
Signature · 1 line
2.46.0
[PULL 19/44] hw/pci: replace assert(false) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/pci/pci-stub.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/pci/pci-stub.c +2 -2
@@ -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 ; }
Signature · 1 line
2.46.0
[PULL 24/44] block: remove break after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- block/ssh.c | 1 - 1 file changed, 1 deletion(-)
block/ssh.c +0 -1
@@ -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 :
Signature · 1 line
2.46.0
[PULL 13/44] qobject: replace assert(0) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- qobject/qlit.c | 2 +- qobject/qnum.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
qobject/qlit.c +1 -1
@@ -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 ;
qobject/qnum.c +4 -4
@@ -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 ; }
Signature · 1 line
2.46.0
[PULL 03/44] tests/functional: Convert the xtensa lx60 Avocado test
In reply to Thomas HuthUse the new launch_kernel function to convert this test in a simple way.
Message-ID: <[email protected]>
--- 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
MAINTAINERS +1 -0
@@ -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 -------
tests/avocado/boot_linux_console.py +0 -9
@@ -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')
tests/functional/meson.build +4 -0
@@ -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
tests/functional/test_xtensa_lx60.py new file +26 -0
@@ -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()
Signature · 1 line
2.46.0
[PULL 44/44] .gitlab-ci.d: Make separate collapsible log sections for build and test
In reply to Thomas HuthFrom: Peter Maydell <[email protected]>
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.
Message-ID: <[email protected]>
--- .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
.gitlab-ci.d/buildtest-template.yml +14 -0
@@ -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
.gitlab-ci.d/buildtest.yml +1 -0
@@ -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
.gitlab-ci.d/crossbuild-template.yml +25 -0
@@ -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
scripts/ci/gitlab-ci-section new file +29 -0
@@ -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" +}
Signature · 1 line
2.46.0
[PULL 29/44] target/arm: remove break after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- target/arm/hyp_gdbstub.c | 1 - 1 file changed, 1 deletion(-)
target/arm/hyp_gdbstub.c +0 -1
@@ -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 */
Signature · 1 line
2.46.0
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
[PULL 32/44] tcg/loongarch64: remove break after g_assert_not_reached()
From: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- tcg/loongarch64/tcg-target.c.inc | 1 - 1 file changed, 1 deletion(-)
tcg/loongarch64/tcg-target.c.inc +0 -1
@@ -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;
Signature · 1 line
2.46.0
[PULL 12/44] migration: replace assert(0) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- migration/migration-hmp-cmds.c | 2 +- migration/postcopy-ram.c | 14 +++++++------- migration/ram.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-)
migration/migration-hmp-cmds.c +1 -1
@@ -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) {
migration/postcopy-ram.c +7 -7
@@ -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
migration/ram.c +3 -3
@@ -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__) */
Signature · 1 line
2.46.0
[PULL 39/44] qobject: remove return after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- qobject/qnum.c | 4 ---- 1 file changed, 4 deletions(-)
qobject/qnum.c +0 -4
@@ -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 ; }/**
Signature · 1 line
2.46.0
[PULL 01/44] tests/functional/qemu_test: Add a function for launching kernels more easily
In reply to Thomas HuthThe 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: <[email protected]>
--- tests/functional/qemu_test/linuxkernel.py | 12 ++++++++++++ 1 file changed, 12 insertions(+)
tests/functional/qemu_test/linuxkernel.py +12 -0
@@ -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
Signature · 1 line
2.46.0
[PULL 06/44] tests/functional: Convert the mac ppc Avocado tests
In reply to Thomas HuthThe g3beige and mac99 tests use the same asset, so put them together in a new test_ppc_mac.py file.
Message-ID: <[email protected]>
--- 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
MAINTAINERS +2 -0
@@ -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 <[email protected]>
@@ -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 <[email protected]>
tests/avocado/boot_linux_console.py +0 -30
@@ -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.
tests/functional/meson.build +1 -0
@@ -106,6 +106,7 @@ tests_ppc_system_thorough = [ 'ppc_40p', 'ppc_amiga', 'ppc_bamboo', + 'ppc_mac', 'ppc_mpc8544ds', 'ppc_virtex_ml507', ]
tests/functional/test_ppc_mac.py new file +38 -0
@@ -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()
Signature · 1 line
2.46.0
[PULL 26/44] hw/net: remove break after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/net/net_rx_pkt.c | 1 - 1 file changed, 1 deletion(-)
hw/net/net_rx_pkt.c +0 -1
@@ -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);
Signature · 1 line
2.46.0
[PULL 40/44] qom: remove return after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- qom/object.c | 1 - 1 file changed, 1 deletion(-)
qom/object.c +0 -1
@@ -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)
Signature · 1 line
2.46.0
[PULL 41/44] tests/qtest: remove return after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- tests/qtest/acpi-utils.c | 1 - 1 file changed, 1 deletion(-)
tests/qtest/acpi-utils.c +0 -1
@@ -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 ; }
Signature · 1 line
2.46.0
[PULL 38/44] migration: remove return after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- migration/dirtyrate.c | 1 - migration/postcopy-ram.c | 7 ------- migration/ram.c | 2 -- 3 files changed, 10 deletions(-)
migration/dirtyrate.c +0 -1
@@ -229,7 +229,6 @@ static int time_unit_to_power(TimeUnit time_unit)return -3 ;default :g_assert_not_reached (); -return 0 ; } }
migration/postcopy-ram.c +0 -7
@@ -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
migration/ram.c +0 -2
@@ -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 )
Signature · 1 line
2.46.0
[PULL 17/44] hw/net: replace assert(false) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- 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(-)
hw/net/e1000e_core.c +1 -1
@@ -561,7 +561,7 @@ e1000e_rss_calc_hash(E1000ECore *core, type = NetPktRssIpV6Ex;break ;default : -assert (false); +g_assert_not_reached ();return 0 ; }
hw/net/igb_core.c +1 -1
@@ -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 ; }
hw/net/net_rx_pkt.c +1 -1
@@ -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 ; }
Signature · 1 line
2.46.0
[PULL 07/44] tests/functional: Convert the r2d sh4 Avocado test
In reply to Thomas HuthThis 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: <[email protected]>
--- 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
MAINTAINERS +1 -0
@@ -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 --------------
tests/avocado/boot_linux_console.py +0 -25
@@ -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)
tests/functional/meson.build +4 -0
@@ -127,6 +127,10 @@ tests_s390x_system_thorough = [ 's390x_topology', ] +tests_sh4_system_thorough = [ + 'sh4_r2d', +] + tests_sparc_system_thorough = [ 'sparc_sun4m', ]
tests/functional/test_sh4_r2d.py new file +31 -0
@@ -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()
Signature · 1 line
2.46.0
[PULL 34/44] hw/hyperv: remove return after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/hyperv/hyperv_testdev.c | 1 - hw/hyperv/vmbus.c | 3 --- 2 files changed, 4 deletions(-)
hw/hyperv/hyperv_testdev.c +0 -1
@@ -89,7 +89,6 @@ static TestSintRoute *sint_route_find(HypervTestDev *dev, } }g_assert_not_reached (); -return NULL ; } static void sint_route_destroy(HypervTestDev *dev,
hw/hyperv/vmbus.c +0 -3
@@ -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)
Signature · 1 line
2.46.0
[PULL 14/44] target/ppc: replace assert(0) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- target/ppc/dfp_helper.c | 8 ++++---- target/ppc/mmu_helper.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
target/ppc/dfp_helper.c +4 -4
@@ -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))) { \
target/ppc/mmu_helper.c +1 -1
@@ -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);
Signature · 1 line
2.46.0
[PULL 43/44] .gitlab-ci.d: Split build and test in cross build job templates
In reply to Thomas HuthFrom: Peter Maydell <[email protected]>
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.
Message-ID: <[email protected]>
--- .gitlab-ci.d/crossbuild-template.yml | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)
.gitlab-ci.d/crossbuild-template.yml +20 -3
@@ -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
Signature · 1 line
2.46.0
[PULL 20/44] hw/ppc: replace assert(false) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/ppc/spapr_events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/ppc/spapr_events.c +1 -1
@@ -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 ; }
Signature · 1 line
2.46.0
[PULL 42/44] scripts/checkpatch.pl: emit error when using assert(false)
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- scripts/checkpatch.pl | 4 ++++ 1 file changed, 4 insertions(+)
scripts/checkpatch.pl +4 -0
@@ -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); }
Signature · 1 line
2.46.0
[PULL 28/44] hw/tpm: remove break after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/tpm/tpm_spapr.c | 1 - 1 file changed, 1 deletion(-)
hw/tpm/tpm_spapr.c +0 -1
@@ -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);
Signature · 1 line
2.46.0
[PULL 37/44] hw/ppc: remove return after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/ppc/ppc.c | 1 - hw/ppc/spapr_events.c | 1 - 2 files changed, 2 deletions(-)
hw/ppc/ppc.c +0 -1
@@ -267,7 +267,6 @@ static void power9_set_irq(void *opaque, int pin, int level)break ;default :g_assert_not_reached (); -return ; } }
hw/ppc/spapr_events.c +0 -1
@@ -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 ) {
Signature · 1 line
2.46.0
[PULL 09/44] hw/acpi: replace assert(0) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/acpi/aml-build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/acpi/aml-build.c +1 -1
@@ -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);
Signature · 1 line
2.46.0
[PULL 35/44] hw/net: remove return after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/net/e1000e_core.c | 2 -- hw/net/igb_core.c | 2 -- hw/net/vmxnet3.c | 1 - 3 files changed, 5 deletions(-)
hw/net/e1000e_core.c +0 -2
@@ -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
hw/net/igb_core.c +0 -2
@@ -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
hw/net/vmxnet3.c +0 -1
@@ -456,7 +456,6 @@ vmxnet3_setup_tx_offloads(VMXNET3State *s)default :g_assert_not_reached (); -return false; }return true;
Signature · 1 line
2.46.0
[PULL 22/44] target/i386/kvm: replace assert(false) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- target/i386/kvm/kvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
target/i386/kvm/kvm.c +2 -2
@@ -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;
Signature · 1 line
2.46.0
[PULL 11/44] hw/net: replace assert(0) with g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- hw/net/i82596.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
hw/net/i82596.c +1 -1
@@ -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 */
Signature · 1 line
2.46.0
[PULL 33/44] include/qemu: remove return after g_assert_not_reached()
In reply to Thomas HuthFrom: Pierrick Bouvier <[email protected]>
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.
Message-ID: <[email protected]>
--- include/qemu/pmem.h | 1 - 1 file changed, 1 deletion(-)
include/qemu/pmem.h +0 -1
@@ -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
Signature · 1 line
2.46.0
Quoted 120 lines · Thomas Huth
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-25for 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 upassert()statements, useg_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 testPierrick Bouvier (34):
hw/acpi: replace assert(0) withg_assert_not_reached()hw/arm: replace assert(0) withg_assert_not_reached()hw/net: replace assert(0) withg_assert_not_reached()
migration: replace assert(0) withg_assert_not_reached()
qobject: replace assert(0) withg_assert_not_reached()target/ppc: replace assert(0) withg_assert_not_reached()
block: replace assert(false) withg_assert_not_reached()hw/hyperv: replace assert(false) withg_assert_not_reached()hw/net: replace assert(false) withg_assert_not_reached()hw/nvme: replace assert(false) withg_assert_not_reached()hw/pci: replace assert(false) withg_assert_not_reached()hw/ppc: replace assert(false) withg_assert_not_reached()
migration: replace assert(false) withg_assert_not_reached()target/i386/kvm: replace assert(false) withg_assert_not_reached()accel/tcg: remove break afterg_assert_not_reached()
block: remove break afterg_assert_not_reached()hw/acpi: remove break afterg_assert_not_reached()hw/net: remove break afterg_assert_not_reached()hw/scsi: remove break afterg_assert_not_reached()hw/tpm: remove break afterg_assert_not_reached()target/arm: remove break afterg_assert_not_reached()target/riscv: remove break afterg_assert_not_reached()
fpu: remove break afterg_assert_not_reached()tcg/loongarch64: remove break afterg_assert_not_reached()include/qemu: remove return afterg_assert_not_reached()hw/hyperv: remove return afterg_assert_not_reached()hw/net: remove return afterg_assert_not_reached()hw/pci: remove return afterg_assert_not_reached()hw/ppc: remove return afterg_assert_not_reached()
migration: remove return afterg_assert_not_reached()
qobject: remove return afterg_assert_not_reached()
qom: remove return afterg_assert_not_reached()tests/qtest: remove return afterg_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 fromboot_linux_console.pyMAINTAINERS | 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(-)
Quoted 8 lines
create mode 100644
scripts/ci/gitlab-ci-sectioncreate mode 100755tests/functional/test_arm_vexpress.pycreate mode 100755tests/functional/test_ppc64_e500.pycreate mode 100755tests/functional/test_ppc_mac.pycreate mode 100755tests/functional/test_sh4_r2d.pycreate mode 100755tests/functional/test_sparc_sun4m.pycreate mode 100755tests/functional/test_xtensa_lx60.py
Thanks for pulling the assert cleanup series.
Peter Maydell
AppliedQuoted 9 lines · Thomas Huth
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
Quoted 9 lines
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 upassert()statements, useg_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
Re: [PULL 02/44] tests/functional: Convert the vexpressa9 Avocado test
In reply to Thomas HuthQuoted 6 lines · Thomas Huth
Use the new
launch_kernelfunction to convert this test in a simple way.Message-ID: <[email protected]>
Reviewed-by Richard Henderson <[email protected]>Signed-off-by Thomas Huth <[email protected]>
Quoted 7 lines
--- 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
Re: [PULL 02/44] tests/functional: Convert the vexpressa9 Avocado test
Quoted 22 lines · Peter Maydell
Quoted 6 lines · Thomas Huth
Use the new
launch_kernelfunction to convert this test in a simple way.Message-ID: <[email protected]>
Reviewed-by Richard Henderson <[email protected]>Signed-off-by Thomas Huth <[email protected]>Quoted 7 lines
--- 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.pyHi. 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
Quoted 5 lines
This new site has just stopped working: download
attempts return a 503. This breaks our CI:
https://gitlab.com/qemu-project/qemu/-/jobs/7955655569Should we switch back?
Yes, patch sent:
https://lore.kernel.org/qemu-devel/[email protected]/
Thomas