From 48d9e53fff0fd2616c058bff182eb4dd8bb69250 Mon Sep 17 00:00:00 2001 From: Jakub Sitnicki Date: Mon, 21 Mar 2022 11:02:14 +0100 Subject: [PATCH] s390x: Override serial console arguments for qemu As Alice Frosi reported (PR #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 --- virtme/architectures.py | 12 ++++++++++-- virtme/commands/run.py | 4 +--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/virtme/architectures.py b/virtme/architectures.py index ba16138..1380096 100644 --- a/virtme/architectures.py +++ b/virtme/architectures.py @@ -43,6 +43,12 @@ def serial_console_args() -> List[str]: def qemu_nodisplay_args() -> List[str]: return ['-vga', 'none', '-display', 'none'] + @staticmethod + def qemu_serial_console_args() -> List[str]: + # We should be using the new-style -device serialdev,chardev=xyz, + # but many architecture-specific serial devices don't support that. + return ['-serial', 'chardev:console'] + @staticmethod def config_base() -> List[str]: return [] @@ -281,14 +287,16 @@ def qemuargs(self, is_native): # default console ret.extend(['-nodefaults']) - ret.extend(['-device', 'sclpconsole,chardev=console']) - return ret @staticmethod def config_base(): return ['CONFIG_MARCH_Z900=y'] + @staticmethod + def qemu_serial_console_args(): + return ['-device', 'sclpconsole,chardev=console'] + ARCHES = {arch.virtmename: arch for arch in [ Arch_x86('x86_64'), Arch_x86('i386'), diff --git a/virtme/commands/run.py b/virtme/commands/run.py index f11444e..5a266f2 100644 --- a/virtme/commands/run.py +++ b/virtme/commands/run.py @@ -376,9 +376,7 @@ def do_it() -> int: qemuargs.extend(['-serial', 'none']) qemuargs.extend(['-chardev', 'stdio,id=console,signal=off,mux=on']) - # We should be using the new-style -device serialdev,chardev=xyz, - # but many architecture-specific serial devices don't support that. - qemuargs.extend(['-serial', 'chardev:console']) + qemuargs.extend(arch.qemu_serial_console_args()) qemuargs.extend(['-mon', 'chardev=console'])