]> git.proxmox.com Git - mirror_qemu.git/commitdiff
scripts/qemu.py: allow arches use KVM for their 32bit cousins
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 22 Jan 2019 11:49:57 +0000 (11:49 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Fri, 8 Feb 2019 17:32:35 +0000 (17:32 +0000)
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>
scripts/qemu.py

index 0a5e02eb56ed39e1bda14ea171a88d2f997748a9..32b00af5cca7eb564fa44341fcd758f1a0a0cfd5 100644 (file)
@@ -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)