Skip to content

Commit

Permalink
Merge tag 'pull-request-2024-09-25' of https://gitlab.com/thuth/qemu
Browse files Browse the repository at this point in the history
…into staging

* 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

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmbz7xgRHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbWm6A//eVn+tzyyKCX/xdXlf7XyVpezvRpTFPOS
# HyO0WMkCf2kGmu6qYKx/fDZg86opdQzPLH2gPkuVrGOMZ0Z2630DjH0jNih8lL9Q
# J1oRX5YlU92chlzNmq59WB/j9CKd91ILtOoaPBuZkDob57yGEYVzCPqetVvF7L2+
# +rbnccrNPumGJFt035fxUGiGfgsmp28MHQzDwQdyr38uGjyNlqvqidfC8Vj1qzqP
# B7HvhGB/vkF0eHaanMt2el/ZuLKf+qeCi//F/CiXGMYnuKXyShA/Db6xvMElw1jB
# aQdwphP71IO+cxjJLaNjDHKGFstArsM/E21qlaSTBi+FTmPiwVULpVTiBmWsjhOh
# /klpdgRHf0hL2MciYKyOWgjlTocx3rEKjCTe2U5tpta9fp9CrlgMQotjDZIbohGI
# ULNahrW3Zmg4EmXDApfhYMXsQsSgWas9QSkmxzJzDp0VC7tf2Oq7RxeySrlw9MCx
# OG2qQY+rNcJ3NnpATjfAJpT1kg/IahDOCNHfLEaj1u13XVQIthVADvHwy5WxbwRP
# mwp3V9e9sUoznkM2eV646lzmkMim/WdYBF0YpT7eBs80+GoXZ0thx9IqWmwzX/ox
# rndBczVN+RY6PydJP40yljdvS7ArRT73wHqL6yKHfDpvFc4/p5mxTWwLQ3yJbXbE
# T3I+wtgfBU8=
# =FH7b
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 25 Sep 2024 12:08:08 BST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "[email protected]"
# gpg: Good signature from "Thomas Huth <[email protected]>" [full]
# gpg:                 aka "Thomas Huth <[email protected]>" [full]
# gpg:                 aka "Thomas Huth <[email protected]>" [full]
# gpg:                 aka "Thomas Huth <[email protected]>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2024-09-25' of https://gitlab.com/thuth/qemu: (44 commits)
  .gitlab-ci.d: Make separate collapsible log sections for build and test
  .gitlab-ci.d: Split build and test in cross build job templates
  scripts/checkpatch.pl: emit error when using assert(false)
  tests/qtest: remove return after g_assert_not_reached()
  qom: remove return after g_assert_not_reached()
  qobject: remove return after g_assert_not_reached()
  migration: remove return after g_assert_not_reached()
  hw/ppc: remove return after g_assert_not_reached()
  hw/pci: remove return after g_assert_not_reached()
  hw/net: remove return after g_assert_not_reached()
  hw/hyperv: remove return after g_assert_not_reached()
  include/qemu: remove return after g_assert_not_reached()
  tcg/loongarch64: remove break after g_assert_not_reached()
  fpu: remove break after g_assert_not_reached()
  target/riscv: remove break after g_assert_not_reached()
  target/arm: remove break after g_assert_not_reached()
  hw/tpm: remove break after g_assert_not_reached()
  hw/scsi: remove break after g_assert_not_reached()
  hw/net: remove break after g_assert_not_reached()
  hw/acpi: remove break after g_assert_not_reached()
  ...

Signed-off-by: Peter Maydell <[email protected]>
  • Loading branch information
pm215 committed Sep 28, 2024
2 parents 4ae7d11 + dc05b26 commit 173c427
Show file tree
Hide file tree
Showing 51 changed files with 384 additions and 234 deletions.
14 changes: 14 additions & 0 deletions .gitlab-ci.d/buildtest-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 ||
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitlab-ci.d/buildtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 45 additions & 3 deletions .gitlab-ci.d/crossbuild-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +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"
Expand All @@ -18,18 +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"
- make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
- 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.
Expand All @@ -46,16 +62,29 @@
paths:
- ccache/
key: "$CI_JOB_NAME"
before_script:
- source scripts/ci/gitlab-ci-section
- JOBS=$(expr $(nproc) + 1)
script:
- export CCACHE_BASEDIR="$(pwd)"
- export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
- export CCACHE_MAXSIZE="500M"
- 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
- make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
- 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
Expand All @@ -65,18 +94,31 @@
paths:
- ccache/
key: "$CI_JOB_NAME"
before_script:
- source scripts/ci/gitlab-ci-section
- JOBS=$(expr $(nproc) + 1)
script:
- export CCACHE_BASEDIR="$(pwd)"
- export CCACHE_DIR="$CCACHE_BASEDIR/ccache"
- 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"
- make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS
- 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
Expand Down
7 changes: 7 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -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]>
Expand Down Expand Up @@ -1444,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]
Expand Down Expand Up @@ -1472,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]>
Expand All @@ -1487,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]>
Expand Down Expand Up @@ -1675,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
--------------
Expand All @@ -1692,6 +1697,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]>
Expand Down Expand Up @@ -1914,6 +1920,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
-------
Expand Down
1 change: 0 additions & 1 deletion accel/tcg/plugin-gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ static void inject_mem_cb(struct qemu_plugin_dyn_cb *cb,
break;
default:
g_assert_not_reached();
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion block/qcow2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion block/ssh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions fpu/softfloat-parts.c.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -1386,7 +1385,6 @@ static FloatPartsN *partsN(minmax)(FloatPartsN *a, FloatPartsN *b,
break;
default:
g_assert_not_reached();
break;
}
}

Expand Down
3 changes: 1 addition & 2 deletions hw/acpi/aml-build.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,7 @@ void aml_append(Aml *parent_ctx, Aml *child)
case AML_NO_OPCODE:
break;
default:
assert(0);
break;
g_assert_not_reached();
}
build_append_array(parent_ctx->buf, buf);
build_free_array(buf);
Expand Down
2 changes: 1 addition & 1 deletion hw/arm/highbank.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
7 changes: 3 additions & 4 deletions hw/hyperv/hyperv_testdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ static TestSintRoute *sint_route_find(HypervTestDev *dev,
return sint_route;
}
}
assert(false);
return NULL;
g_assert_not_reached();
}

static void sint_route_destroy(HypervTestDev *dev,
Expand Down Expand Up @@ -187,7 +186,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)
Expand Down Expand Up @@ -237,7 +236,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)
Expand Down
15 changes: 6 additions & 9 deletions hw/hyperv/vmbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1874,7 +1874,7 @@ static void send_create_gpadl(VMBus *vmbus)
}
}

assert(false);
g_assert_not_reached();
}

static bool complete_create_gpadl(VMBus *vmbus)
Expand All @@ -1889,8 +1889,7 @@ static bool complete_create_gpadl(VMBus *vmbus)
}
}

assert(false);
return false;
g_assert_not_reached();
}

static void handle_gpadl_teardown(VMBus *vmbus,
Expand Down Expand Up @@ -1931,7 +1930,7 @@ static void send_teardown_gpadl(VMBus *vmbus)
}
}

assert(false);
g_assert_not_reached();
}

static bool complete_teardown_gpadl(VMBus *vmbus)
Expand All @@ -1946,8 +1945,7 @@ static bool complete_teardown_gpadl(VMBus *vmbus)
}
}

assert(false);
return false;
g_assert_not_reached();
}

static void handle_open_channel(VMBus *vmbus, vmbus_message_open_channel *msg,
Expand Down Expand Up @@ -1996,7 +1994,7 @@ static void send_open_channel(VMBus *vmbus)
}
}

assert(false);
g_assert_not_reached();
}

static bool complete_open_channel(VMBus *vmbus)
Expand All @@ -2020,8 +2018,7 @@ static bool complete_open_channel(VMBus *vmbus)
}
}

assert(false);
return false;
g_assert_not_reached();
}

static void vdev_reset_on_close(VMBusDevice *vdev)
Expand Down
4 changes: 1 addition & 3 deletions hw/net/e1000e_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,7 @@ e1000e_rss_calc_hash(E1000ECore *core,
type = NetPktRssIpV6Ex;
break;
default:
assert(false);
return 0;
g_assert_not_reached();
}

return net_rx_pkt_calc_rss_hash(pkt, type, (uint8_t *) &core->mac[RSSRK]);
Expand Down Expand Up @@ -841,7 +840,6 @@ e1000e_ring_free_descr_num(E1000ECore *core, const E1000ERingInfo *r)
}

g_assert_not_reached();
return 0;
}

static inline bool
Expand Down
Loading

0 comments on commit 173c427

Please sign in to comment.