[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 13/29] python/qemu: Add binutils::binary_get_devices()
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 13/29] python/qemu: Add binutils::binary_get_devices() |
Date: |
Wed, 29 Jan 2020 22:23:29 +0100 |
Since QEMU binaries can be built with various configurations,
the list of devices linked in can vary.
Add a helper to query the list of devices built into a
QEMU binary.
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
python/qemu/binutils.py | 9 +++++++++
tests/acceptance/core_scripts.py | 8 ++++++++
2 files changed, 17 insertions(+)
diff --git a/python/qemu/binutils.py b/python/qemu/binutils.py
index bba203bc8d..9633ba8efd 100644
--- a/python/qemu/binutils.py
+++ b/python/qemu/binutils.py
@@ -96,3 +96,12 @@ def binary_get_accels(qemu_bin):
'''
accel_types = binary_get_qom_implementations(qemu_bin, "accel", False)
return [a.strip("-accel") for a in accel_types]
+
+def binary_get_devices(qemu_bin):
+ '''
+ Get list of devices supported by a QEMU binary
+
+ @param qemu_bin (str): path to the QEMU binary
+ @return list of devices supported by the binary
+ '''
+ return binary_get_qom_implementations(qemu_bin, "device", False)
diff --git a/tests/acceptance/core_scripts.py b/tests/acceptance/core_scripts.py
index 7380f2f49b..a62eb2e46b 100644
--- a/tests/acceptance/core_scripts.py
+++ b/tests/acceptance/core_scripts.py
@@ -18,6 +18,7 @@ sys.path.append(os.path.join(os.path.dirname(__file__), '..',
'..', 'python'))
from avocado_qemu import Test
from qemu.binutils import binary_get_accels
from qemu.binutils import binary_get_arch
+from qemu.binutils import binary_get_devices
from qemu.binutils import binary_get_machines
from qemu.binutils import binary_get_qom_implementations
from qemu.binutils import binary_get_version
@@ -69,3 +70,10 @@ class PythonQemuCoreScripts(Test):
self.assertNotIn("accel", accels)
# qtest is always available
self.assertIn("qtest", accels)
+
+ def test_get_devices(self):
+ logger = logging.getLogger('core')
+ devices = binary_get_devices(self.qemu_bin)
+ for d in devices:
+ logger.debug('device: {}'.format(d))
+ self.assertIn("migration", devices)
--
2.21.1
- Re: [PATCH v2 04/29] tests/acceptance: Use 'version-min' tag to verify QEMU binary version, (continued)
[PATCH v2 05/29] tests/acceptance: Restrict X86CPUModelAliases test to QEMU >= 4.1, Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 06/29] python/qemu: Add binutils::binary_get_arch(), Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 07/29] tests/acceptance: Use the 'arch' tag to verify QEMU binary target, Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 08/29] python/qemu: Add binutils::binary_get_machines(), Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 10/29] python/qemu: Add binutils::binary_get_qom_implementations(), Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 09/29] tests/acceptance: Use 'machine' tag to check if available in QEMU binary, Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 11/29] python/qemu: Add binutils::binary_get_accels(), Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 12/29] python/qemu/accel: Use binutils::binary_get_accels(), Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 13/29] python/qemu: Add binutils::binary_get_devices(),
Philippe Mathieu-Daudé <=
[PATCH v2 15/29] tests: rename virtio_seg_max_adjust to virtio_check_params, Philippe Mathieu-Daudé, 2020/01/29
[RFC PATCH v2 14/29] tests/acceptance: Use 'device' tags to check availability in QEMU binary, Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 16/29] tests/acceptance/virtio_check_params: Only remove listed machines, Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 17/29] tests/acceptance/virtio_check_params: Improve exception logging, Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 19/29] tests/acceptance/virtio_check_params: Only test Xen as superuser, Philippe Mathieu-Daudé, 2020/01/29
[PATCH v2 18/29] tests/acceptance/virtio_check_params: List machine being tested, Philippe Mathieu-Daudé, 2020/01/29