From b59b82ededdde6ec3e63a666f5c0cfb5a3f22e2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sat, 13 Oct 2018 02:40:26 +0200 Subject: tests/vm: Extract the kvm_available() handy function 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-2-f4bug@amsat.org> Reviewed-by: Richard Henderson Signed-off-by: Fam Zheng --- scripts/qemu.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts') diff --git a/scripts/qemu.py b/scripts/qemu.py index f099ce7..9fc0be4 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -26,6 +26,10 @@ import tempfile LOG = logging.getLogger(__name__) +def kvm_available(target_arch=None): + 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', -- cgit v1.1