aboutsummaryrefslogtreecommitdiff
path: root/python/qemu
diff options
context:
space:
mode:
authorWainer dos Santos Moschetta <wainersm@redhat.com>2019-12-16 16:14:37 -0300
committerCleber Rosa <crosa@redhat.com>2019-12-16 18:39:04 -0500
commitd3ca7bb599b777271316c17a5221c5ee28815833 (patch)
tree465842cad9c5233a14943bfcc2cbbe4dad1b7fff /python/qemu
parent53a049d7d78e5ccf6d4c0d7b0edb18f8b999df94 (diff)
downloadqemu-d3ca7bb599b777271316c17a5221c5ee28815833.zip
qemu-d3ca7bb599b777271316c17a5221c5ee28815833.tar.gz
qemu-d3ca7bb599b777271316c17a5221c5ee28815833.tar.bz2
python/qemu: accel: Add tcg_available() method
This adds a method to check if the tcg accelerator is enabled in the QEMU binary. Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20191216191438.93418-5-wainersm@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
Diffstat (limited to 'python/qemu')
-rw-r--r--python/qemu/accel.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/qemu/accel.py b/python/qemu/accel.py
index 5fce3aa..0b38ddf 100644
--- a/python/qemu/accel.py
+++ b/python/qemu/accel.py
@@ -67,3 +67,11 @@ def kvm_available(target_arch=None, qemu_bin=None):
if qemu_bin and "kvm" not in list_accel(qemu_bin):
return False
return True
+
+def tcg_available(qemu_bin):
+ """
+ Check if TCG is available.
+
+ @param qemu_bin (str): path to the QEMU binary
+ """
+ return 'tcg' in list_accel(qemu_bin)