summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Bennée2019-01-22 12:49:57 +0100
committerAlex Bennée2019-02-08 18:32:35 +0100
commit2d4e4c01b1a9f5c4f9d066cfdd3fd66542faa8bb (patch)
treec8eca17e463e4065fe73489abbf4f0e5f6ff1341
parenttests/vm: expose BUILD_TARGET, TARGET_LIST and EXTRA_CONFIGURE_OPTS (diff)
downloadqemu-2d4e4c01b1a9f5c4f9d066cfdd3fd66542faa8bb.tar.gz
qemu-2d4e4c01b1a9f5c4f9d066cfdd3fd66542faa8bb.tar.xz
qemu-2d4e4c01b1a9f5c4f9d066cfdd3fd66542faa8bb.zip
scripts/qemu.py: allow arches use KVM for their 32bit cousins
A lot of architectures can run their 32 bit cousins on KVM so the kvm_available function needs to be a little less restricting when deciding if KVM is available. Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
-rw-r--r--scripts/qemu.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/qemu.py b/scripts/qemu.py
index 0a5e02eb56..32b00af5cc 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -25,10 +25,18 @@ import tempfile
LOG = logging.getLogger(__name__)
+# Mapping host architecture to any additional architectures it can
+# support which often includes its 32 bit cousin.
+ADDITIONAL_ARCHES = {
+ "x86_64" : "i386",
+ "aarch64" : "armhf"
+}
def kvm_available(target_arch=None):
- if target_arch and target_arch != os.uname()[4]:
- return False
+ host_arch = os.uname()[4]
+ if target_arch and target_arch != host_arch:
+ if target_arch != ADDITIONAL_ARCHES.get(host_arch):
+ return False
return os.access("/dev/kvm", os.R_OK | os.W_OK)