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/core | |
parent | cf3dc71eb5141761c3aed0d936e390aeaa73a88b (diff) | |
download | qemu-cfc58cf37362a931990efc75f3f580dfec49ac1e.tar.gz qemu-cfc58cf37362a931990efc75f3f580dfec49ac1e.tar.bz2 qemu-cfc58cf37362a931990efc75f3f580dfec49ac1e.zip |
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/core')
-rw-r--r-- | hw/core/machine.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/hw/core/machine.c b/hw/core/machine.c index 6dbbc85b97..0bb96ad457 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -257,6 +257,20 @@ static void machine_set_usb(Object *obj, bool value, Error **errp) ms->usb_disabled = !value; } +static bool machine_get_graphics(Object *obj, Error **errp) +{ + MachineState *ms = MACHINE(obj); + + return ms->enable_graphics; +} + +static void machine_set_graphics(Object *obj, bool value, Error **errp) +{ + MachineState *ms = MACHINE(obj); + + ms->enable_graphics = value; +} + static bool machine_get_igd_gfx_passthru(Object *obj, Error **errp) { MachineState *ms = MACHINE(obj); @@ -382,6 +396,7 @@ static void machine_initfn(Object *obj) ms->kvm_shadow_mem = -1; ms->dump_guest_core = true; ms->mem_merge = true; + ms->enable_graphics = true; object_property_add_str(obj, "accel", machine_get_accel, machine_set_accel, NULL); @@ -460,6 +475,12 @@ static void machine_initfn(Object *obj) object_property_set_description(obj, "usb", "Set on/off to enable/disable usb", NULL); + object_property_add_bool(obj, "graphics", + machine_get_graphics, + machine_set_graphics, NULL); + object_property_set_description(obj, "graphics", + "Set on/off to enable/disable graphics emulation", + NULL); object_property_add_bool(obj, "igd-passthru", machine_get_igd_gfx_passthru, machine_set_igd_gfx_passthru, NULL); |