]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
python/qemu: accel: Add tcg_available() method
authorWainer dos Santos Moschetta <wainersm@redhat.com>
Mon, 16 Dec 2019 19:14:37 +0000 (16:14 -0300)
committerCleber Rosa <crosa@redhat.com>
Mon, 16 Dec 2019 23:39:04 +0000 (18:39 -0500)
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>
python/qemu/accel.py

index 5fce3aa3dd76a347f3c9496c1f3e717ff00adab9..0b38ddf0abf3d7cb229f40f87d61a02a57148c93 100644 (file)
@@ -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)