Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kunit: tool: Add support for overriding the QEMU serial port

On some platforms, the console is not the first serial port. To make
this work, the first serial port in QEMU must be set to "null".

Add support for this by adding an optional "serial" parameter, which
defaults to "stdio", and can be overridden by platform-specific
configuration.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Geert Uytterhoeven and committed by
Shuah Khan
5ffb8629 cb8865fd

+3 -1
+2 -1
tools/testing/kunit/kunit_kernel.py
··· 106 106 self._kernel_path = qemu_arch_params.kernel_path 107 107 self._kernel_command_line = qemu_arch_params.kernel_command_line + ' kunit_shutdown=reboot' 108 108 self._extra_qemu_params = qemu_arch_params.extra_qemu_params 109 + self._serial = qemu_arch_params.serial 109 110 110 111 def make_arch_config(self, base_kunitconfig: kunit_config.Kconfig) -> kunit_config.Kconfig: 111 112 kconfig = kunit_config.parse_from_string(self._kconfig) ··· 122 121 '-append', ' '.join(params + [self._kernel_command_line]), 123 122 '-no-reboot', 124 123 '-nographic', 125 - '-serial', 'stdio'] + self._extra_qemu_params 124 + '-serial', self._serial] + self._extra_qemu_params 126 125 # Note: shlex.join() does what we want, but requires python 3.8+. 127 126 print('Running tests with:\n$', ' '.join(shlex.quote(arg) for arg in qemu_command)) 128 127 return subprocess.Popen(qemu_command,
+1
tools/testing/kunit/qemu_config.py
··· 17 17 kernel_path: str 18 18 kernel_command_line: str 19 19 extra_qemu_params: List[str] 20 + serial: str = 'stdio'