All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: kvm@vger.kernel.org
Cc: drjones@redhat.com, "Alex Bennée" <alex.bennee@linaro.org>
Subject: [kvm-unit-tests PATCH 4/7] run/arm: introduce usingkvm var and use it
Date: Fri,  3 Jul 2015 14:48:44 +0100	[thread overview]
Message-ID: <1435931327-8073-5-git-send-email-alex.bennee@linaro.org> (raw)
In-Reply-To: <1435931327-8073-1-git-send-email-alex.bennee@linaro.org>

This makes it easier to force KVM off in later patches.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 arm/run | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/arm/run b/arm/run
index 6b42a2e..493ce0d 100755
--- a/arm/run
+++ b/arm/run
@@ -8,6 +8,16 @@ fi
 source config.mak
 processor="$PROCESSOR"
 
+# Default to using KVM if available and on the right ARM host
+usingkvm=0
+if [ -c /dev/kvm ]; then
+	if [ "$HOST" = "arm" ] && [ "$ARCH" = "arm" ]; then
+		usingkvm=1
+	elif [ "$HOST" = "aarch64" ]; then
+		usingkvm=1
+	fi
+fi
+
 qemu="${QEMU:-qemu-system-$ARCH_NAME}"
 qpath=$(which $qemu 2>/dev/null)
 
@@ -39,7 +49,7 @@ chr_testdev='-device virtio-serial-device'
 chr_testdev+=' -device virtconsole,chardev=ctd -chardev testdev,id=ctd'
 
 # arm64 must use '-cpu host' with kvm
-if [ "$(arch)" = "aarch64" ] && [ "$ARCH" = "arm64" ] && [ -c /dev/kvm ]; then
+if [ $usingkvm = 1 ] && [ "$ARCH" = "arm64" ]; then
 	processor="host"
 fi
 
-- 
2.4.5


  parent reply	other threads:[~2015-07-03 13:48 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-03 13:48 [kvm-unit-tests PATCH 0/7] A number of small arm/run fixes Alex Bennée
2015-07-03 13:48 ` [kvm-unit-tests PATCH 1/7] READ: add some CONTRIBUTING notes Alex Bennée
2015-07-06 12:56   ` Andrew Jones
2015-07-03 13:48 ` [kvm-unit-tests PATCH 2/7] configure: emit HOST=$host to config.mak Alex Bennée
2015-07-06 12:57   ` Andrew Jones
2015-07-03 13:48 ` [kvm-unit-tests PATCH 3/7] arm/run: set indentation defaults for emacs Alex Bennée
2015-07-06 12:59   ` Andrew Jones
2015-07-03 13:48 ` Alex Bennée [this message]
2015-07-06 13:02   ` [kvm-unit-tests PATCH 4/7] run/arm: introduce usingkvm var and use it Andrew Jones
2015-07-03 13:48 ` [kvm-unit-tests PATCH 5/7] arm/run: clean-up setting of accel options Alex Bennée
2015-07-06 13:06   ` Andrew Jones
2015-07-03 13:48 ` [kvm-unit-tests PATCH 6/7] arm/run: introduce basic option parsing Alex Bennée
2015-07-06 13:22   ` Andrew Jones
2015-07-03 13:48 ` [kvm-unit-tests PATCH 7/7] arm/run: add --debug option Alex Bennée
2015-07-06 13:14   ` Andrew Jones
2015-07-07  6:45     ` Alex Bennée

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435931327-8073-5-git-send-email-alex.bennee@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.