python/qemu: split arg between base and harness lists

There are argument we add because we want the test harness to control
QEMU and arguments we default for handling the display and machine
type. Split the obvious ones between base_args and a new list called
harness_args.

We will leave the complexity of the serial ports for now.

Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260619155657.944220-2-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
Alex Bennée
2026-06-19 16:56:50 +01:00
parent b833716681
commit 220530755b

View File

@@ -292,8 +292,8 @@ def _load_io_log(self) -> None:
self._iolog = iolog.read()
@property
def _base_args(self) -> List[str]:
args = ['-display', 'none', '-vga', 'none']
def _harness_args(self) -> List[str]:
args: List[str] = []
if self._qmp_set:
if self._sock_pair:
@@ -307,8 +307,6 @@ def _base_args(self) -> List[str]:
args.extend(['-chardev', moncdev, '-mon',
'chardev=mon,mode=control'])
if self._machine is not None:
args.extend(['-machine', self._machine])
for _ in range(self._console_index):
args.extend(['-serial', 'null'])
if self._console_set:
@@ -323,6 +321,13 @@ def _base_args(self) -> List[str]:
args.extend(['-device', device])
return args
@property
def _base_args(self) -> List[str]:
args: List[str] = ['-display', 'none', '-vga', 'none']
if self._machine is not None:
args.extend(['-machine', self._machine])
return args
@property
def args(self) -> List[str]:
"""Returns the list of arguments given to the QEMU binary."""
@@ -366,6 +371,7 @@ def _pre_launch(self) -> None:
self._qemu_full_args = tuple(chain(
self._wrapper,
[self._binary],
self._harness_args,
self._base_args,
self._args
))