]> Git Repo - qemu.git/commitdiff
vga: add default display to machine class
authorGerd Hoffmann <[email protected]>
Tue, 28 Oct 2014 09:09:11 +0000 (10:09 +0100)
committerMichael S. Tsirkin <[email protected]>
Mon, 3 Nov 2014 16:32:48 +0000 (18:32 +0200)
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 <[email protected]>
Reviewed-by: Michael S. Tsirkin <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
hw/i386/pc.c
include/hw/boards.h
vl.c

index dc2fe6a666216b4518342e22586b6f770ad0f7f1..1205db83bcb91b3cac48c9b7af65e3e011362ba8 100644 (file)
@@ -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;
 }
index 4429a1e3a222c20999184451d6f84226b5fdbaa5..99a172d6526b3d1fc6446a297145b47ec84301bc 100644 (file)
@@ -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/vl.c b/vl.c
index 35c1333eeeac3e77c50151b06a279ab26026b5e0..2c4ea510f1229f8c7a18fd669d127abcf0ff8007 100644 (file)
--- 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";
This page took 0.038108 seconds and 4 git commands to generate.