sga: stop using sgabios rom for 2.11+
PATCH 1/1 sga: stop using sgabios rom for 2.11+
seabios 1.11 got builtin serial console support, so we don't need sgabios any more. "-machine graphics=off" should be used instead. update sga.c accordingly.
Signed-off-by Gerd Hoffmann <[email protected]>
--- include/hw/compat.h | 4 ++++ hw/misc/sga.c | 26 +++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-)
include/hw/compat.h +4 -0
@@ -14,6 +14,10 @@ .driver = "i82559a",\ .property = "x-use-alt-device-id",\ .value = "false",\ + },{\ + .driver = "sga",\ + .property = "use-sgabios",\ + .value = "true",\ },#define HW_COMPAT_2_9 \
hw/misc/sga.c +25 -1
@@ -25,6 +25,7 @@* */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/pci/pci.h" #include "hw/i386/pc.h" #include "hw/loader.h"
@@ -37,18 +38,41 @@typedef struct ISASGAState {ISADevice parent_obj; +bool use_sgabios; }ISASGAState ;static void sga_realizefn (DeviceState *dev,Error **errp) { -rom_add_vga (SGABIOS_FILENAME ); +MachineState *machine =MACHINE (qdev_get_machine ()); +ISASGAState *sga =SGA (dev); + +if (sga->use_sgabios) { +rom_add_vga (SGABIOS_FILENAME ); + }else if (machine->enable_graphics) { +warn_report ("sgabios is deprecated for your machine type, " +"please use -machine graphics=off instead of " +"-device sga" ); +rom_add_vga (SGABIOS_FILENAME ); + }else { +/* +* For this machine type we expect SeaBIOS to provide a +* serial console for -machine graphics=off. No need to +* do anything here. +*/ + } } +static Property sga_properties[] = { +DEFINE_PROP_BOOL ("use-sgabios" , ISASGAState, use_sgabios, false), +DEFINE_PROP_END_OF_LIST (), +}; +static void sga_class_initfn (ObjectClass *klass,void *data) {DeviceClass *dc =DEVICE_CLASS (klass);set_bit (DEVICE_CATEGORY_DISPLAY , dc->categories); + dc->props = sga_properties; dc->realize = sga_realizefn; dc->desc ="Serial Graphics Adapter" ; }
Signature · 1 line
2.9.3