mirror of
https://github.com/systemd/systemd
synced 2024-10-14 20:17:52 +00:00
test: make qemu use kvm if available
If we're running in a KVM virtualized environment (such as Semaphore's Docker enabled platform), pass '-cpu host' to QEMU.
This commit is contained in:
parent
1b1eae69ce
commit
dbf43a42b8
|
@ -68,8 +68,7 @@ selinux=0 \
|
||||||
$KERNEL_APPEND \
|
$KERNEL_APPEND \
|
||||||
"
|
"
|
||||||
|
|
||||||
QEMU_OPTIONS="-machine accel=kvm:tcg \
|
QEMU_OPTIONS="-smp $QEMU_SMP \
|
||||||
-smp $QEMU_SMP \
|
|
||||||
-net none \
|
-net none \
|
||||||
-m 512M \
|
-m 512M \
|
||||||
-nographic \
|
-nographic \
|
||||||
|
@ -80,6 +79,10 @@ $KERNEL_APPEND \
|
||||||
QEMU_OPTIONS="$QEMU_OPTIONS -initrd $INITRD"
|
QEMU_OPTIONS="$QEMU_OPTIONS -initrd $INITRD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -c /dev/kvm ]; then
|
||||||
|
QEMU_OPTIONS="$QEMU_OPTIONS -machine accel=kvm -enable-kvm -cpu host"
|
||||||
|
fi
|
||||||
|
|
||||||
( set -x
|
( set -x
|
||||||
$QEMU_BIN $QEMU_OPTIONS -append "$KERNEL_APPEND" $TESTDIR/rootdisk.img ) || return 1
|
$QEMU_BIN $QEMU_OPTIONS -append "$KERNEL_APPEND" $TESTDIR/rootdisk.img ) || return 1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue