summary refs log tree commit diff stats
path: root/scripts/qemu.py
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-10-27 19:55:08 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-10-27 19:55:08 +0100
commit285278ca785f5fa9a570927e1c0958a2ca2b2150 (patch)
tree82dd2beaa4bfd5787069b792d2633d1a0bc91809 /scripts/qemu.py
parent179f9ac887973c818b2578bd79fa3ed2522657d4 (diff)
parent63a24c5e2354833a84f18bdf0e857fad8812f65b (diff)
downloadfocaccia-qemu-285278ca785f5fa9a570927e1c0958a2ca2b2150.tar.gz
focaccia-qemu-285278ca785f5fa9a570927e1c0958a2ca2b2150.zip
Merge remote-tracking branch 'remotes/famz/tags/testing-pull-request' into staging
Testing patches

One fix for mingw build and some improvements in VM based testing, many thanks
to Paolo and Phil.

# gpg: Signature made Fri 26 Oct 2018 15:15:13 BST
# gpg:                using RSA key CA35624C6A9171C6
# gpg: Good signature from "Fam Zheng <famz@redhat.com>"
# Primary key fingerprint: 5003 7CB7 9706 0F76 F021  AD56 CA35 624C 6A91 71C6

* remotes/famz/tags/testing-pull-request:
  tests/vm: Do not abuse parallelism when HOST != TARGET architecture
  tests/vm: Do not use -enable-kvm if HOST != TARGET architecture
  tests/vm: Let kvm_available() work in cross environments
  tests/vm: Add a BaseVM::arch property
  tests/vm: Display remaining seconds to wait for a VM to start
  tests/vm: Do not use the -smp option with a single cpu
  tests/vm: Do not abuse parallelism when KVM is not available
  tests/vm: Extract the kvm_available() handy function
  tests: docker: update test-mingw for GTK+ 2.0 removal

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/qemu.py')
-rw-r--r--scripts/qemu.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/qemu.py b/scripts/qemu.py
index f099ce7278..bcd24aad82 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -26,6 +26,12 @@ import tempfile
 LOG = logging.getLogger(__name__)
 
 
+def kvm_available(target_arch=None):
+    if target_arch and target_arch != os.uname()[4]:
+        return False
+    return os.access("/dev/kvm", os.R_OK | os.W_OK)
+
+
 #: Maps machine types to the preferred console device types
 CONSOLE_DEV_TYPES = {
     r'^clipper$': 'isa-serial',