Read QEMU_CFG_NOGRAPHIC, if set add etc/sercon-port file to enable the serial console.
Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- src/fw/paravirt.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/src/fw/paravirt.c b/src/fw/paravirt.c index 5b23d786be..9674ab8ba8 100644 --- a/src/fw/paravirt.c +++ b/src/fw/paravirt.c @@ -14,6 +14,7 @@ #include "hw/pci.h" // pci_config_readw #include "hw/pcidevice.h" // pci_probe_devices #include "hw/pci_regs.h" // PCI_DEVICE_ID +#include "hw/serialio.h" // PORT_SERIAL1 #include "hw/rtc.h" // CMOS_* #include "malloc.h" // malloc_tmp #include "output.h" // dprintf @@ -210,6 +211,7 @@ qemu_platform_setup(void) #define QEMU_CFG_SIGNATURE 0x00 #define QEMU_CFG_ID 0x01 #define QEMU_CFG_UUID 0x02 +#define QEMU_CFG_NOGRAPHIC 0x04 #define QEMU_CFG_NUMA 0x0d #define QEMU_CFG_BOOT_MENU 0x0e #define QEMU_CFG_NB_CPUS 0x05 @@ -511,6 +513,12 @@ qemu_cfg_legacy(void) qemu_romfile_add("etc/irq0-override", QEMU_CFG_IRQ0_OVERRIDE, 0, 1); qemu_romfile_add("etc/max-cpus", QEMU_CFG_MAX_CPUS, 0, 2);
+ // serial console + u16 nogfx = 0; + qemu_cfg_read_entry(&nogfx, QEMU_CFG_NOGRAPHIC, sizeof(nogfx)); + if (nogfx) + const_romfile_add_int("etc/sercon-port", PORT_SERIAL1); + // NUMA data u64 numacount; qemu_cfg_read_entry(&numacount, QEMU_CFG_NUMA, sizeof(numacount));