diff mbox series

[8.2,bugfix] vl: disable default serial when xen-console is enabled

Message ID 44fb0420a60dc4e4ca2666a676a0055a1a5f1b51.camel@infradead.org (mailing list archive)
State New, archived
Headers show
Series [8.2,bugfix] vl: disable default serial when xen-console is enabled | expand

Commit Message

David Woodhouse Nov. 9, 2023, 11:37 a.m. UTC
From: David Woodhouse <dwmw@amazon.co.uk>

If a Xen console is configured on the command line, do not add a default
serial port.

Fixes: 1bec1cc0da4 ("ui/console: allow to override the default VC")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
(Bonus points for adding a Xen console by default for Xen guests
instead of a serial port, but I'll look at that for 8.3.)

Without this, the example command lines in the documentation at
https://qemu-project.gitlab.io/qemu/system/i386/xen.html fail:

 $ ./qemu-system-x86_64 --accel kvm,xen-version=0x40011,kernel-irqchip=split \
    -display none -chardev stdio,mux=on,id=char0,signal=off -mon char0 \
    -device xen-console,chardev=char0  -drive file=${GUEST_IMAGE},if=xen
qemu-system-x86_64: cannot use stdio by multiple character devices
qemu-system-x86_64: could not connect serial device to character backend 'stdio'

Maybe that Fixes: tag is a little harsh; I think the two pull requests
were outstanding at the same time... but mine was pulled first :)

 system/vl.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/system/vl.c b/system/vl.c
index 5af7ced2a1..8109231834 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -198,6 +198,7 @@  static const struct {
     const char *driver;
     int *flag;
 } default_list[] = {
+    { .driver = "xen-console",          .flag = &default_serial    },
     { .driver = "isa-serial",           .flag = &default_serial    },
     { .driver = "isa-parallel",         .flag = &default_parallel  },
     { .driver = "isa-fdc",              .flag = &default_floppy    },