[PATCH 2/7] test: enable VirtIO keyboard

Ahmad Fatoum a.fatoum at barebox.org
Mon Apr 13 00:44:45 PDT 2026


The QEMU ARM64 Virt machine has no input method by default.
As we already had VirtIO input for the web demo, enable it when
--graphic is enabled.

The barebox VirtIO input driver was ported from Linux and both support
only VirtIO v1 devices, so we need to explicitly set
virtio-mmio.force-legacy=false for this to work.

Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
 conftest.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/conftest.py b/conftest.py
index b0d314f3f345..c27e7a9546a1 100644
--- a/conftest.py
+++ b/conftest.py
@@ -175,6 +175,7 @@ def strategy(request, target, pytestconfig):  # noqa: max-complexity=30
 
     if "virtio-mmio" in features:
         virtio = "device"
+        strategy.append_qemu_args('-global virtio-mmio.force-legacy=false')
     if "virtio-pci" in features:
         virtio = "pci,disable-modern=off"
         features.append("pci")
@@ -210,6 +211,7 @@ def strategy(request, target, pytestconfig):  # noqa: max-complexity=30
             graphics = '-device VGA'
         elif virtio:
             graphics = '-vga none -device ramfb'
+            graphics += f' -device virtio-keyboard-{virtio}'
         else:
             pytest.exit("--graphics unsupported for target\n", 1)
 
-- 
2.47.3




More information about the barebox mailing list