From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xj2mp-0002cy-Qs for qemu-devel@nongnu.org; Tue, 28 Oct 2014 05:10:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xj2mj-0004nZ-Lg for qemu-devel@nongnu.org; Tue, 28 Oct 2014 05:09:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xj2mj-0004nN-EI for qemu-devel@nongnu.org; Tue, 28 Oct 2014 05:09:49 -0400 From: Gerd Hoffmann Date: Tue, 28 Oct 2014 10:09:11 +0100 Message-Id: <1414487352-6027-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1414487352-6027-1-git-send-email-kraxel@redhat.com> References: <1414487352-6027-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] vga: add default display to machine class List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: ajax@redhat.com, Gerd Hoffmann , Anthony Liguori , "Michael S. Tsirkin" 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 --- hw/i386/pc.c | 1 + include/hw/boards.h | 2 ++ vl.c | 5 ++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 61aba9f..ef37528 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1536,6 +1536,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/include/hw/boards.h b/include/hw/boards.h index e07c03f..2a09a10 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -39,6 +39,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; }; @@ -98,6 +99,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 50b97b4..fb5ab79 100644 --- a/vl.c +++ b/vl.c @@ -1437,6 +1437,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; } @@ -4193,7 +4194,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"; -- 1.8.3.1