Skip to content

Commit 48d9e53

Browse files
committed
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 <[email protected]>
1 parent beb8514 commit 48d9e53

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

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
@@ -376,9 +376,7 @@ def do_it() -> int:
376376
qemuargs.extend(['-serial', 'none'])
377377
qemuargs.extend(['-chardev', 'stdio,id=console,signal=off,mux=on'])
378378

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

383381
qemuargs.extend(['-mon', 'chardev=console'])
384382

0 commit comments

Comments
 (0)