diff mbox series

[v3,6/8] tests/vm: Let kvm_available() work in cross environments

Message ID 20181013004034.6968-7-f4bug@amsat.org
State New
Headers show
Series tests/vm: Improvements when KVM is not available | expand

Commit Message

Philippe Mathieu-Daudé Oct. 13, 2018, 12:40 a.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 scripts/qemu.py | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/scripts/qemu.py b/scripts/qemu.py
index 9fc0be4828..bcd24aad82 100644
--- a/scripts/qemu.py
+++ b/scripts/qemu.py
@@ -27,6 +27,8 @@  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)