summary refs log tree commit diff stats
path: root/python/qemu/accel.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/qemu/accel.py')
-rw-r--r--python/qemu/accel.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/python/qemu/accel.py b/python/qemu/accel.py
index 3ec6bdcfdb..297933df2a 100644
--- a/python/qemu/accel.py
+++ b/python/qemu/accel.py
@@ -17,6 +17,7 @@ accelerators.
 import logging
 import os
 import subprocess
+from typing import List, Optional
 
 
 LOG = logging.getLogger(__name__)
@@ -30,7 +31,7 @@ ADDITIONAL_ARCHES = {
 }
 
 
-def list_accel(qemu_bin):
+def list_accel(qemu_bin: str) -> List[str]:
     """
     List accelerators enabled in the QEMU binary.
 
@@ -50,7 +51,8 @@ def list_accel(qemu_bin):
     return [acc.strip() for acc in out.splitlines()[1:]]
 
 
-def kvm_available(target_arch=None, qemu_bin=None):
+def kvm_available(target_arch: Optional[str] = None,
+                  qemu_bin: Optional[str] = None) -> bool:
     """
     Check if KVM is available using the following heuristic:
       - Kernel module is present in the host;
@@ -73,7 +75,7 @@ def kvm_available(target_arch=None, qemu_bin=None):
     return True
 
 
-def tcg_available(qemu_bin):
+def tcg_available(qemu_bin: str) -> bool:
     """
     Check if TCG is available.