From 67a52f34569cb70a54d3b3bb1c0dc7e7a280ca54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 13 Oct 2018 02:40:31 +0200 Subject: [PATCH] tests/vm: Let kvm_available() work in cross environments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20181013004034.6968-7-f4bug@amsat.org> Reviewed-by: Richard Henderson Signed-off-by: Fam Zheng --- scripts/qemu.py | 2 ++ 1 file changed, 2 insertions(+) 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)