[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 28/29] vga: add default display to machine class
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 28/29] vga: add default display to machine class |
Date: |
Mon, 3 Nov 2014 14:46:14 +0200 |
From: Gerd Hoffmann <address@hidden>
This allows machine classes to specify which display device they want
as default. If unspecified the current behavior (try cirrus, failing
that try stdvga, failing that use no display) will be used.
Signed-off-by: Gerd Hoffmann <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/boards.h | 2 ++
hw/i386/pc.c | 1 +
vl.c | 5 ++++-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 4429a1e..99a172d 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -40,6 +40,7 @@ struct QEMUMachine {
int is_default;
const char *default_machine_opts;
const char *default_boot_order;
+ const char *default_display;
GlobalProperty *compat_props;
const char *hw_version;
};
@@ -100,6 +101,7 @@ struct MachineClass {
int is_default;
const char *default_machine_opts;
const char *default_boot_order;
+ const char *default_display;
GlobalProperty *compat_props;
const char *hw_version;
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index dc2fe6a..1205db8 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1526,6 +1526,7 @@ static void pc_generic_machine_class_init(ObjectClass
*oc, void *data)
mc->is_default = qm->is_default;
mc->default_machine_opts = qm->default_machine_opts;
mc->default_boot_order = qm->default_boot_order;
+ mc->default_display = qm->default_display;
mc->compat_props = qm->compat_props;
mc->hw_version = qm->hw_version;
}
diff --git a/vl.c b/vl.c
index 35c1333..2c4ea51 100644
--- a/vl.c
+++ b/vl.c
@@ -1444,6 +1444,7 @@ static void machine_class_init(ObjectClass *oc, void
*data)
mc->is_default = qm->is_default;
mc->default_machine_opts = qm->default_machine_opts;
mc->default_boot_order = qm->default_boot_order;
+ mc->default_display = qm->default_display;
mc->compat_props = qm->compat_props;
mc->hw_version = qm->hw_version;
}
@@ -4223,7 +4224,9 @@ int main(int argc, char **argv, char **envp)
/* If no default VGA is requested, the default is "none". */
if (default_vga) {
- if (cirrus_vga_available()) {
+ if (machine_class->default_display) {
+ vga_model = machine_class->default_display;
+ } else if (cirrus_vga_available()) {
vga_model = "cirrus";
} else if (vga_available()) {
vga_model = "std";
--
MST
- [Qemu-devel] [PULL 17/29] cpu-hotplug: rename function for better readability, (continued)
- [Qemu-devel] [PULL 17/29] cpu-hotplug: rename function for better readability, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 18/29] acpi/cpu-hotplug: introduce helper function to keep bit setting in one place, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 19/29] -machine vmport=off: Allow disabling of VMWare ioport emulation, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 20/29] hw/pci: fixed error flow in pci_qdev_init, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 21/29] hw/pci: fixed hotplug crash when using rombar=0 with devices having romfile, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 22/29] hw/virtio/vring/event_idx: fix the vring_avail_event error, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 23/29] pc: Add pc_compat_2_1() function, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 24/29] smbios: Encode UUID according to SMBIOS specification, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 26/29] qemu-char: fix tcp_get_fds, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 25/29] hw/i386/acpi-build.c: Fix memory leak in acpi_build_tables_cleanup(), Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 28/29] vga: add default display to machine class,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 29/29] vga: flip qemu 2.2 pc machine types from cirrus to stdvga, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 27/29] vhost-user: fix mmap offset calculation, Michael S. Tsirkin, 2014/11/03