mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-08 17:49:07 +08:00
vmtest: tweak qemu invocation for s390x
We need a different binary and console. Also use a fixed number of cores in order to avoid OOM in case a builder has too many of them. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
This commit is contained in:
committed by
Andrii Nakryiko
parent
26e196d449
commit
554054d876
@@ -295,7 +295,7 @@ fi
|
|||||||
echo "Disk image: $IMG" >&2
|
echo "Disk image: $IMG" >&2
|
||||||
|
|
||||||
tmp=
|
tmp=
|
||||||
ARCH_DIR="$DIR/x86_64"
|
ARCH_DIR="$DIR/$ARCH"
|
||||||
mkdir -p "$ARCH_DIR"
|
mkdir -p "$ARCH_DIR"
|
||||||
mnt="$(mktemp -d -p "$DIR" mnt.XXXXXXXXXX)"
|
mnt="$(mktemp -d -p "$DIR" mnt.XXXXXXXXXX)"
|
||||||
|
|
||||||
@@ -459,10 +459,27 @@ if kvm-ok ; then
|
|||||||
else
|
else
|
||||||
accel="-cpu qemu64 -machine accel=tcg"
|
accel="-cpu qemu64 -machine accel=tcg"
|
||||||
fi
|
fi
|
||||||
qemu-system-x86_64 -nodefaults -display none -serial mon:stdio -no-reboot \
|
case "$ARCH" in
|
||||||
${accel} -smp "$(nproc)" -m 4G \
|
s390x)
|
||||||
|
qemu="qemu-system-s390x"
|
||||||
|
console="ttyS1"
|
||||||
|
smp=2
|
||||||
|
;;
|
||||||
|
x86_64)
|
||||||
|
qemu="qemu-system-x86_64"
|
||||||
|
console="ttyS0,115200"
|
||||||
|
smp=$(nproc)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported architecture"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
"$qemu" -nodefaults -display none -serial mon:stdio \
|
||||||
|
${accel} -smp "$smp" -m 4G \
|
||||||
-drive file="$IMG",format=raw,index=1,media=disk,if=virtio,cache=none \
|
-drive file="$IMG",format=raw,index=1,media=disk,if=virtio,cache=none \
|
||||||
-kernel "$vmlinuz" -append "root=/dev/vda rw console=ttyS0,115200 kernel.panic=-1 $APPEND"
|
-kernel "$vmlinuz" -append "root=/dev/vda rw console=$console kernel.panic=-1 $APPEND"
|
||||||
|
|
||||||
sudo mount -o loop "$IMG" "$mnt"
|
sudo mount -o loop "$IMG" "$mnt"
|
||||||
if exitstatus="$(cat "$mnt/exitstatus" 2>/dev/null)"; then
|
if exitstatus="$(cat "$mnt/exitstatus" 2>/dev/null)"; then
|
||||||
printf '\nTests exit status: %s\n' "$exitstatus" >&2
|
printf '\nTests exit status: %s\n' "$exitstatus" >&2
|
||||||
|
|||||||
Reference in New Issue
Block a user