Commit 1531b9ec8c for qemu.org
commit 1531b9ec8c2e7033cbb737e2428827677be0a1b0
Author: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Date: Fri Jul 10 12:03:17 2026 +0300
tests/functional: fix querying available machines
Aliases are not handled, and that's why tests used them
are skipped, like this:
PYTHONPATH=python:tests/functional \
QEMU_TEST_QEMU_BINARY=$PWD/build/qemu-system-x86_64 \
MESON_BUILD_ROOT=$PWD/build \
./build/pyvenv/bin/python3 tests/functional/x86_64/test_hotplug_blk.py
TAP version 13
ok 1 test_hotplug_blk.HotPlugBlk.test # SKIP no support for machine q35
1..1
Fixes: 0e7aa78b0bee50 ("tests/functional: use QMP to query available machines")
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20260710090317.498350-1-vsementsov@yandex-team.ru>
Signed-off-by: Thomas Huth <th.huth@posteo.eu>
diff --git a/tests/functional/qemu_test/testcase.py b/tests/functional/qemu_test/testcase.py
index 4912a47a46..e4179d165c 100644
--- a/tests/functional/qemu_test/testcase.py
+++ b/tests/functional/qemu_test/testcase.py
@@ -325,9 +325,12 @@ def set_machine(self, machinename):
resp = tmp_vm.qmp('query-machines')
machines = resp.get('return', [])
- cls._machines = [
- m.get('name') for m in machines if 'name' in m
- ]
+ cls._machines = []
+ for m in machines:
+ if 'name' in m:
+ cls._machines.append(m['name'])
+ if 'alias' in m:
+ cls._machines.append(m['alias'])
finally:
try: