summaryrefslogtreecommitdiffstats
path: root/python/qemu/accel.py
diff options
context:
space:
mode:
authorJohn Snow2020-05-29 00:21:29 +0200
committerPhilippe Mathieu-Daudé2020-05-31 18:25:30 +0200
commit8dfac2edb2146d87b25543c70e25723f3d4dbd60 (patch)
treeb5906c7db9efff8a51790e2fb2fe1d2f9b11e8d0 /python/qemu/accel.py
parentpython/qemu: delint and add pylintrc (diff)
downloadqemu-8dfac2edb2146d87b25543c70e25723f3d4dbd60.tar.gz
qemu-8dfac2edb2146d87b25543c70e25723f3d4dbd60.tar.xz
qemu-8dfac2edb2146d87b25543c70e25723f3d4dbd60.zip
python/qemu: delint; add flake8 config
Mostly, ignore the "no bare except" rule, because flake8 is not contextual and cannot determine if we re-raise. Pylint can, though, so always prefer pylint for that. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200528222129.23826-5-jsnow@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'python/qemu/accel.py')
-rw-r--r--python/qemu/accel.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/python/qemu/accel.py b/python/qemu/accel.py
index 36ae85791e..7fabe62920 100644
--- a/python/qemu/accel.py
+++ b/python/qemu/accel.py
@@ -23,11 +23,12 @@ LOG = logging.getLogger(__name__)
# Mapping host architecture to any additional architectures it can
# support which often includes its 32 bit cousin.
ADDITIONAL_ARCHES = {
- "x86_64" : "i386",
- "aarch64" : "armhf",
- "ppc64le" : "ppc64",
+ "x86_64": "i386",
+ "aarch64": "armhf",
+ "ppc64le": "ppc64",
}
+
def list_accel(qemu_bin):
"""
List accelerators enabled in the QEMU binary.
@@ -47,6 +48,7 @@ def list_accel(qemu_bin):
# Skip the first line which is the header.
return [acc.strip() for acc in out.splitlines()[1:]]
+
def kvm_available(target_arch=None, qemu_bin=None):
"""
Check if KVM is available using the following heuristic:
@@ -69,6 +71,7 @@ def kvm_available(target_arch=None, qemu_bin=None):
return False
return True
+
def tcg_available(qemu_bin):
"""
Check if TCG is available.