Skip to content

Commit

Permalink
s390x: Override serial console arguments for qemu
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jsitnicki committed Mar 21, 2022
1 parent beb8514 commit 48d9e53
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
12 changes: 10 additions & 2 deletions virtme/architectures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 []
Expand Down Expand Up @@ -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'),
Expand Down
4 changes: 1 addition & 3 deletions virtme/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand Down

0 comments on commit 48d9e53

Please sign in to comment.