Skip to content
This repository was archived by the owner on Jan 12, 2025. It is now read-only.

Commit d83cf7b

Browse files
jsitnickiAndrea Righi
authored andcommitted
s390x: Override serial console arguments for qemu
As Alice Frosi reported (PR amluto#58), passing -device sclpconsole,chardev=console together with -serial chardev:console to qemu-system-s390x is not supported. Following Andrew Lutomirski's suggestion, use the latter as the default for configuring the serial console on all architectures but s390x, where we override it in favor of sclpconsole. Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
1 parent 3572a49 commit d83cf7b

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

virtme/architectures.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ def serial_console_args() -> List[str]:
4343
def qemu_nodisplay_args() -> List[str]:
4444
return ['-vga', 'none', '-display', 'none']
4545

46+
@staticmethod
47+
def qemu_serial_console_args() -> List[str]:
48+
# We should be using the new-style -device serialdev,chardev=xyz,
49+
# but many architecture-specific serial devices don't support that.
50+
return ['-serial', 'chardev:console']
51+
4652
@staticmethod
4753
def config_base() -> List[str]:
4854
return []
@@ -281,14 +287,16 @@ def qemuargs(self, is_native):
281287
# default console
282288
ret.extend(['-nodefaults'])
283289

284-
ret.extend(['-device', 'sclpconsole,chardev=console'])
285-
286290
return ret
287291

288292
@staticmethod
289293
def config_base():
290294
return ['CONFIG_MARCH_Z900=y']
291295

296+
@staticmethod
297+
def qemu_serial_console_args():
298+
return ['-device', 'sclpconsole,chardev=console']
299+
292300
ARCHES = {arch.virtmename: arch for arch in [
293301
Arch_x86('x86_64'),
294302
Arch_x86('i386'),

virtme/commands/run.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,7 @@ def do_it() -> int:
387387
qemuargs.extend(['-serial', 'none'])
388388
qemuargs.extend(['-chardev', 'stdio,id=console,signal=off,mux=on'])
389389

390-
# We should be using the new-style -device serialdev,chardev=xyz,
391-
# but many architecture-specific serial devices don't support that.
392-
qemuargs.extend(['-serial', 'chardev:console'])
390+
qemuargs.extend(arch.qemu_serial_console_args())
393391

394392
qemuargs.extend(['-mon', 'chardev=console'])
395393

0 commit comments

Comments
 (0)