Blob Blame History Raw
From cafe6675c2e54cbdc576785bc98e5f7fda76ba7c Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Tue, 14 Aug 2018 16:31:00 +0200
Subject: [PATCH] test/run-qemu: move -cpu host to kvm args

---
 fedora-test.sh |  1 +
 test/run-qemu  | 12 ++++++------
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/fedora-test.sh b/fedora-test.sh
index ee506caf..146c7f2f 100755
--- a/fedora-test.sh
+++ b/fedora-test.sh
@@ -36,6 +36,7 @@ dnf -y install --best --allowerasing \
     kernel \
     dhcp-client \
     /usr/bin/qemu-kvm \
+    /usr/bin/qemu-system-$(uname -i) \
     e2fsprogs \
     $NULL
 
diff --git a/test/run-qemu b/test/run-qemu
index c28de2db..4eb497ff 100755
--- a/test/run-qemu
+++ b/test/run-qemu
@@ -4,12 +4,12 @@
 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
 [[ -x /usr/bin/qemu ]] && BIN=/usr/bin/qemu && ARGS=""
-$(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu "
-[[ -c /dev/kvm && -x /usr/bin/kvm ]] && BIN=/usr/bin/kvm && ARGS=""
-[[ -c /dev/kvm && -x /usr/bin/qemu-kvm ]] && BIN=/usr/bin/qemu-kvm && ARGS=""
-[[ -c /dev/kvm && -x /usr/libexec/qemu-kvm ]] && BIN=/usr/libexec/qemu-kvm && ARGS=""
+$(lsmod | grep -q '^kqemu ') && BIN=/usr/bin/qemu && ARGS="-kernel-kqemu -cpu host"
+[[ -c /dev/kvm && -x /usr/bin/kvm ]] && BIN=/usr/bin/kvm && ARGS="-cpu host"
+[[ -c /dev/kvm && -x /usr/bin/qemu-kvm ]] && BIN=/usr/bin/qemu-kvm && ARGS="-cpu host"
+[[ -c /dev/kvm && -x /usr/libexec/qemu-kvm ]] && BIN=/usr/libexec/qemu-kvm && ARGS="-cpu host"
 [[ -x /usr/bin/qemu-system-$(uname -i) ]] && BIN=/usr/bin/qemu-system-$(uname -i) && ARGS=""
-[[ -c /dev/kvm && -x /usr/bin/qemu-system-$(uname -i) ]] && BIN=/usr/bin/qemu-system-$(uname -i) && ARGS="-enable-kvm"
+[[ -c /dev/kvm && -x /usr/bin/qemu-system-$(uname -i) ]] && BIN=/usr/bin/qemu-system-$(uname -i) && ARGS="-enable-kvm -cpu host"
 
 [[ $BIN ]] || {
    echo "Could not find a working KVM or QEMU to test with!" >&2
@@ -31,4 +31,4 @@ if ! [ -f "$VMLINUZ" ]; then
     fi
 fi
 
-exec sudo $BIN $ARGS -kernel $VMLINUZ -cpu host "$@"
+exec sudo $BIN $ARGS -kernel $VMLINUZ "$@"