mirror of
https://github.com/systemd/systemd
synced 2024-10-14 20:17:52 +00:00
test: try to determine QEMU_SMP dynamically
If the QEMU_SMP value has not been explicitly set, try to determine it from the number of online CPUs using the nproc utility. If this approach fails, fall back to the default value QEMU_SMP=1. This change should significantly help when running integration tests under QEMU on multicore systems.
This commit is contained in:
parent
2f2a0454ef
commit
5bfb2a93a4
|
@ -134,7 +134,16 @@ run_qemu() {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ "$QEMU_SMP" ] || QEMU_SMP=1
|
# If QEMU_SMP was not explicitly set, try to determine the value 'dynamically'
|
||||||
|
# i.e. use the number of online CPUs on the host machine. If the nproc utility
|
||||||
|
# is not installed or there's some other error when calling it, fall back
|
||||||
|
# to the original value (QEMU_SMP=1).
|
||||||
|
if ! [ "$QEMU_SMP" ]; then
|
||||||
|
if ! QEMU_SMP=$(nproc); then
|
||||||
|
dwarn "nproc utility is not installed, falling back to QEMU_SMP=1"
|
||||||
|
QEMU_SMP=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
find_qemu_bin || return 1
|
find_qemu_bin || return 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue