All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] python/qemu: fix accelerator detection with annotated -accel help
@ 2026-11-12 11:29 marcandre.lureau
  2026-11-13 14:54 ` Daniel P. Berrangé
  0 siblings, 1 reply; 2+ messages in thread
From: marcandre.lureau @ 2026-11-12 11:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: berrange, richard.henderson, Marc-André Lureau, John Snow,
	Cleber Rosa

From: Marc-André Lureau <marcandre.lureau@redhat.com>

QEMU annotates the accelerator names in "-accel help" with their
security status, eg "kvm (secure)". kvm_available() compares the
entries with the plain accelerator name, so the check fails and
functional tests using require_accelerator('kvm') are silently
skipped.

Keep only the accelerator name of each line.

fwiw, I am surprised we don't seem to have a CI that exercice functional
kvm tests, or compare against a baseline to avoid this kind of
regression.

Fixes: d3b770fc6342 ("system: report acclerator security status in help output")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 python/qemu/utils/accel.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/python/qemu/utils/accel.py b/python/qemu/utils/accel.py
index f915b646692e..7e3f43d6b489 100644
--- a/python/qemu/utils/accel.py
+++ b/python/qemu/utils/accel.py
@@ -47,8 +47,9 @@ def list_accel(qemu_bin: str) -> List[str]:
     except:
         LOG.debug("Failed to get the list of accelerators in %s", qemu_bin)
         raise
-    # Skip the first line which is the header.
-    return [acc.strip() for acc in out.splitlines()[1:]]
+    # Skip the first line which is the header, and drop annotations
+    # such as " (secure)" from the accelerator names.
+    return [acc.split(' ')[0] for acc in out.splitlines()[1:]]
 
 
 def kvm_available(target_arch: Optional[str] = None,
-- 
2.56.0.116.g6de20f6092dc



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-13 14:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-12 11:29 [PATCH] python/qemu: fix accelerator detection with annotated -accel help marcandre.lureau
2026-11-13 14:54 ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.