Commit 27bb9b5c6b for qemu.org

commit 27bb9b5c6b65be0baaa39024a880fe30551e1411
Author: Peter Maydell <peter.maydell@linaro.org>
Date:   Thu May 7 20:47:24 2026 +0100

    tests/functional/test_virt_vbsa: Skip UEFI test if virtualization not supported

    If you try to run the functional tests on an AArch64 host which doesn't
    support nested virtualization in KVM, the UEFI test fails with:

       Output: qemu-system-aarch64: mach-virt: host kernel KVM does
       not support providing Virtualization extensions to the guest CPU

    Catch the VMLaunchFailure exception and if it matches the error
    messages the virt board puts out for virtualization not being
    supported, skip the test.

    Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
    Reviewed-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
    Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
    Message-id: 20260507194728.2034696-3-peter.maydell@linaro.org

diff --git a/tests/functional/aarch64/test_virt_vbsa.py b/tests/functional/aarch64/test_virt_vbsa.py
index 57bfe5d7af..04b5ff0f9e 100755
--- a/tests/functional/aarch64/test_virt_vbsa.py
+++ b/tests/functional/aarch64/test_virt_vbsa.py
@@ -17,6 +17,7 @@
 from qemu_test import get_qemu_img, skipIfMissingCommands
 from qemu_test import wait_for_console_pattern
 from qemu_test import exec_command_and_wait_for_pattern as ec_and_wait
+from qemu.machine.machine import VMLaunchFailure


 @skipIfMissingCommands("mformat", "mcopy", "mmd")
@@ -96,7 +97,14 @@ def test_aarch64_vbsa_uefi_tests(self):
                          f'file={img_path},format=raw,if=none,id=drive0')
         self.vm.add_args('-device', 'virtio-blk-pci,drive=drive0')

-        self.vm.launch()
+        try:
+            self.vm.launch()
+        except VMLaunchFailure as excp:
+            if "does not support providing Virtualization" in excp.output:
+                self.skipTest("accelerator has no virtualization support")
+            else:
+                self.log.info("unhandled launch failure: %s", excp.output)
+                raise excp

         # wait for EFI prompt
         self.wait_for_console_pattern('Shell>')