diff options
author | Eduardo Habkost <ehabkost@redhat.com> | 2016-04-19 16:55:25 -0300 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2016-05-20 14:28:54 -0300 |
commit | cfc58cf37362a931990efc75f3f580dfec49ac1e (patch) | |
tree | 86de8478715152ed258c1db3c100efc4d37158c2 /hw/nvram | |
parent | cf3dc71eb5141761c3aed0d936e390aeaa73a88b (diff) |
vl: Replace DT_NOGRAPHIC with machine option
All DisplayType values are just UI options that don't affect any
hardware emulation code, except for DT_NOGRAPHIC. Replace
DT_NOGRAPHIC with DT_NONE plus a new "-machine graphics=on|off"
option, so hardware emulation code don't need to use the
display_type variable.
Cc: Michael Walle <michael@walle.cc>
Cc: Blue Swirl <blauwirbel@gmail.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/nvram')
-rw-r--r-- | hw/nvram/fw_cfg.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 999f480280..cdbdfb5320 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -25,6 +25,7 @@ #include "hw/hw.h" #include "sysemu/sysemu.h" #include "sysemu/dma.h" +#include "hw/boards.h" #include "hw/isa/isa.h" #include "hw/nvram/fw_cfg.h" #include "hw/sysbus.h" @@ -868,16 +869,17 @@ static void fw_cfg_machine_ready(struct Notifier *n, void *data) static void fw_cfg_init1(DeviceState *dev) { FWCfgState *s = FW_CFG(dev); + MachineState *machine = MACHINE(qdev_get_machine()); assert(!object_resolve_path(FW_CFG_PATH, NULL)); - object_property_add_child(qdev_get_machine(), FW_CFG_NAME, OBJECT(s), NULL); + object_property_add_child(OBJECT(machine), FW_CFG_NAME, OBJECT(s), NULL); qdev_init_nofail(dev); fw_cfg_add_bytes(s, FW_CFG_SIGNATURE, (char *)"QEMU", 4); fw_cfg_add_bytes(s, FW_CFG_UUID, qemu_uuid, 16); - fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)(display_type == DT_NOGRAPHIC)); + fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)!machine->enable_graphics); fw_cfg_add_i16(s, FW_CFG_NB_CPUS, (uint16_t)smp_cpus); fw_cfg_add_i16(s, FW_CFG_BOOT_MENU, (uint16_t)boot_menu); fw_cfg_bootsplash(s); |