Skip to content

Commit bd60c1c

Browse files
committed
qemudriver: add a qemu-default display option
The barebox test suite adds an --interactive option to pytest, which allows starting QEMU interactively with the Labgrid Environment YAML to allow manual testing. So far, it wasn't possible to use this with an interactive graphic output, because Labgrid allowed only headless displays or none. none is the default and will configure QEMU with -nographic, which can not be overridden later on and -display also has no default value. To support this use case, add a qemu-default option, which instructs Labgrid to not touch -nographic and -display at all. Signed-off-by: Ahmad Fatoum <[email protected]>
1 parent ac097c1 commit bd60c1c

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGES.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ more performant and the import times are shorter.
1717
New Features in 24.1
1818
~~~~~~~~~~~~~~~~~~~~
1919
- All components can be installed into the same virtualenv again.
20+
- The `QEMUDriver` now supports setting the ``display`` option to
21+
``qemu-default``, which will neither set the QEMU ``-display`` option
22+
or pass along ``-nographic``.
2023

2124
Bug fixes in 24.1
2225
~~~~~~~~~~~~~~~~~

doc/configuration.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2726,6 +2726,7 @@ Arguments:
27262726
- none: Do not create a display device
27272727
- fb-headless: Create a headless framebuffer device
27282728
- egl-headless: Create a headless GPU-backed graphics card. Requires host support
2729+
- qemu-default: Don't override QEMU default settings
27292730

27302731
- nic (str): optional, configuration string to pass to QEMU to create a network interface
27312732

labgrid/driver/qemudriver.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class QEMUDriver(ConsoleExpectMixin, Driver, PowerProtocol, ConsoleProtocol):
4848
none: Do not create a display device
4949
fb-headless: Create a headless framebuffer device
5050
egl-headless: Create a headless GPU-backed graphics card. Requires host support
51+
qemu-default: Don't override QEMU default settings
5152
nic (str): optional, configuration string to pass to QEMU to create a network interface
5253
"""
5354
qemu_bin = attr.ib(validator=attr.validators.instance_of(str))
@@ -85,7 +86,9 @@ class QEMUDriver(ConsoleExpectMixin, Driver, PowerProtocol, ConsoleProtocol):
8586
default="none",
8687
validator=attr.validators.optional(attr.validators.and_(
8788
attr.validators.instance_of(str),
88-
attr.validators.in_(["none", "fb-headless", "egl-headless"]),
89+
attr.validators.in_(
90+
["none", "fb-headless", "egl-headless", "qemu-default"]
91+
),
8992
))
9093
)
9194
nic = attr.ib(
@@ -211,7 +214,7 @@ def get_qemu_base_args(self):
211214
cmd.append("virtio")
212215
cmd.append("-display")
213216
cmd.append("egl-headless")
214-
else:
217+
elif self.display != "qemu-default":
215218
raise ExecutionError(f"Unknown display '{self.display}'")
216219

217220
if self.nic:

0 commit comments

Comments
 (0)