aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qemu.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/qemu.py b/scripts/qemu.py
index b0b2f12ce6..fd4249f7a8 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',