From patchwork Mon Dec 7 12:42:41 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 40482 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DF468B6F0C for ; Tue, 8 Dec 2009 00:04:07 +1100 (EST) Received: from localhost ([127.0.0.1]:42624 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHdFz-0004nv-U8 for incoming@patchwork.ozlabs.org; Mon, 07 Dec 2009 08:04:03 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHcwp-0005Lo-7i for qemu-devel@nongnu.org; Mon, 07 Dec 2009 07:44:15 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHcwi-0005HO-Lu for qemu-devel@nongnu.org; Mon, 07 Dec 2009 07:44:13 -0500 Received: from [199.232.76.173] (port=58675 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHcwi-0005H1-BQ for qemu-devel@nongnu.org; Mon, 07 Dec 2009 07:44:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24922) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHcwh-0000gF-V7 for qemu-devel@nongnu.org; Mon, 07 Dec 2009 07:44:08 -0500 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nB7Ci7w2020229 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Dec 2009 07:44:07 -0500 Received: from zweiblum.home.kraxel.org (vpn2-8-247.ams2.redhat.com [10.36.8.247]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nB7Ci4fL025763; Mon, 7 Dec 2009 07:44:04 -0500 Received: by zweiblum.home.kraxel.org (Postfix, from userid 500) id 9B49C7010F; Mon, 7 Dec 2009 13:43:59 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 7 Dec 2009 13:42:41 +0100 Message-Id: <1260189773-20728-10-git-send-email-kraxel@redhat.com> In-Reply-To: <1260189773-20728-1-git-send-email-kraxel@redhat.com> References: <1260189773-20728-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Gerd Hoffmann , agraf@suse.de, lcapitulino@redhat.com Subject: [Qemu-devel] [FOR 0.12 PATCH v3 09/21] default devices: vga adapter. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Qemu creates a vga display for you in case you didn't specify one on the command line. Right now this is tied to the '-vga ' command line switch, which in turn causes trouble if you are creating your gfx card using '-device VGA,'. This patch adds a variable default_vga which says whenever a default serial line should be added. It is enabled by default. It is cleared when qemu finds '-vga' or '-device {VGA,Cirrus VGA,QEMUware SVGA}' on the command line. '-device VGA' still doesn't work though due to a initialization order issue (vga must init before calling i440fx_init_memory_mappings). Signed-off-by: Gerd Hoffmann --- vl.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/vl.c b/vl.c index d851f46..a99e0fe 100644 --- a/vl.c +++ b/vl.c @@ -193,7 +193,7 @@ int autostart; static int rtc_utc = 1; static int rtc_date_offset = -1; /* -1 means no change */ QEMUClock *rtc_clock; -int vga_interface_type = VGA_CIRRUS; +int vga_interface_type = VGA_NONE; #ifdef TARGET_SPARC int graphic_width = 1024; int graphic_height = 768; @@ -275,6 +275,7 @@ static void *boot_set_opaque; static int default_serial = 1; static int default_parallel = 1; static int default_monitor = 1; +static int default_vga = 1; static struct { const char *driver; @@ -282,6 +283,9 @@ static struct { } default_list[] = { { .driver = "isa-serial", .flag = &default_serial }, { .driver = "isa-parallel", .flag = &default_parallel }, + { .driver = "VGA", .flag = &default_vga }, + { .driver = "Cirrus VGA", .flag = &default_vga }, + { .driver = "QEMUware SVGA", .flag = &default_vga }, }; static int default_driver_check(QemuOpts *opts, void *opaque) @@ -4373,6 +4377,7 @@ static void select_vgahw (const char *p) { const char *opts; + default_vga = 0; vga_interface_type = VGA_NONE; if (strstart(p, "std", &opts)) { vga_interface_type = VGA_STD; @@ -5554,6 +5559,8 @@ int main(int argc, char **argv, char **envp) if (default_monitor) add_device_config(DEV_MONITOR, "vc:80Cx24C"); } + if (default_vga) + vga_interface_type = VGA_CIRRUS; #ifndef _WIN32 if (daemonize) {