@@ -23,7 +23,7 @@
from typing import Optional
# pylint: disable=import-error
-from .accel import kvm_available, list_accel, tcg_available
+from .accel import hvf_available, kvm_available, list_accel, tcg_available
__all__ = (
@@ -82,3 +82,11 @@ def tcg_available(qemu_bin: str) -> bool:
@param qemu_bin (str): path to the QEMU binary
"""
return 'tcg' in list_accel(qemu_bin)
+
+def hvf_available(qemu_bin: str) -> bool:
+ """
+ Check if HVF is available.
+
+ @param qemu_bin (str): path to the QEMU binary
+ """
+ return 'hvf' in list_accel(qemu_bin)
@@ -23,7 +23,7 @@
import uuid
from qemu.machine import QEMUMachine
-from qemu.utils import kvm_available, tcg_available
+from qemu.utils import hvf_available, kvm_available, tcg_available
from .archive import archive_extract
from .asset import Asset
@@ -317,7 +317,9 @@ def require_accelerator(self, accelerator):
:type accelerator: str
"""
checker = {'tcg': tcg_available,
- 'kvm': kvm_available}.get(accelerator)
+ 'kvm': kvm_available,
+ 'hvf': hvf_available,
+ }.get(accelerator)
if checker is None:
self.skipTest("Don't know how to check for the presence "
"of accelerator %s" % accelerator)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- python/qemu/utils/__init__.py | 2 +- python/qemu/utils/accel.py | 8 ++++++++ tests/functional/qemu_test/testcase.py | 6 ++++-- 3 files changed, 13 insertions(+), 3 deletions(-)