From patchwork Thu Mar 15 12:56:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 146941 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 717FBB6FD7 for ; Thu, 15 Mar 2012 23:56:44 +1100 (EST) Received: from localhost ([::1]:51294 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8AEU-00046J-A8 for incoming@patchwork.ozlabs.org; Thu, 15 Mar 2012 08:56:42 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59100) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8AEE-00044p-Ig for qemu-devel@nongnu.org; Thu, 15 Mar 2012 08:56:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S8AE7-0002Fi-Sw for qemu-devel@nongnu.org; Thu, 15 Mar 2012 08:56:26 -0400 Received: from mail-yx0-f173.google.com ([209.85.213.173]:53116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S8AE7-0002FN-M3 for qemu-devel@nongnu.org; Thu, 15 Mar 2012 08:56:19 -0400 Received: by yenr5 with SMTP id r5so3433435yen.4 for ; Thu, 15 Mar 2012 05:56:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer; bh=w344wbaQCXKWUWylX08MkMYMpHN6l/hzRHEC/nxm8p8=; b=My5keld95v9N7QBXcCfYyslxBjTrLkDdV3AOyiwHfOY2gIivSbfKSnpHa4D7B7davz Chl//DtU0mk0l1NelFTYxt/HavgPFhe5OcNjwYo4M9nLYEIy+1XiSi79uWPVOCGs58ko wVmfbxPrJQCa+3o74JZ3ctpfiltQyuiQpCZ6pcORSmROLz0Ma0GOpCIAa896XmExHz0l i0TxDrZ0po+NuAkTEvtaKkdrr0xZcv0Z8sjDit6vTDZCzrKrhyLwHkMfX8XCBZLCTFJy ojqRa+hsLWu/kmE6F+GtqGBrQA9hbd7JmI8Xmebt1kootf8ugbjU5d6ezdjrIO9bvnB0 /ryg== Received: by 10.68.216.132 with SMTP id oq4mr5151174pbc.41.1331816176952; Thu, 15 Mar 2012 05:56:16 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-182-16.ip50.fastwebnet.it. [93.34.182.16]) by mx.google.com with ESMTPS id 4sm1842550pbp.76.2012.03.15.05.56.13 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Mar 2012 05:56:15 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 15 Mar 2012 13:56:02 +0100 Message-Id: <1331816162-3540-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.7.6 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.213.173 Cc: Blue Swirl Subject: [Qemu-devel] [PATCH] vga: disable default VGA if appropriate -device is used X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This is a partial revert of commits a369da5 (vga: improve VGA logic, committed 2012-01-22) and c5bd4f3 (vga: fix -nodefaults -device VGA, 2012-01-24) which broke command-line option parsing in different ways. Since commit a369da5 it has become impossible to specify a VGA device entirely with QemuOpts-enabled options, i.e. without needing an explicit "-vga none". In addition, until commit c5bd4f3 -nodefaults would not disable the device you specified with the legacy "-vga" option, independent of the order. Since commit c5bd4f3 QEMU -nodefaults will override a previous -vga option. I did not reintroduce machine->no_vga. Boards can simply ignore the vga_interface_type variable, and most will indeed do so. Cc: Blue Swirl Signed-off-by: Paolo Bonzini --- vl.c | 25 ++++++++++++++++--------- 1 files changed, 16 insertions(+), 9 deletions(-) diff --git a/vl.c b/vl.c index 65f11f2..fd394c8 100644 --- a/vl.c +++ b/vl.c @@ -272,6 +272,7 @@ static int default_monitor = 1; static int default_floppy = 1; static int default_cdrom = 1; static int default_sdcard = 1; +static int default_vga = 1; static struct { const char *driver; @@ -287,6 +288,12 @@ static struct { { .driver = "virtio-serial-pci", .flag = &default_virtcon }, { .driver = "virtio-serial-s390", .flag = &default_virtcon }, { .driver = "virtio-serial", .flag = &default_virtcon }, + { .driver = "VGA", .flag = &default_vga }, + { .driver = "isa-vga", .flag = &default_vga }, + { .driver = "cirrus-vga", .flag = &default_vga }, + { .driver = "isa-cirrus-vga", .flag = &default_vga }, + { .driver = "vmware-svga", .flag = &default_vga }, + { .driver = "qxl-vga", .flag = &default_vga }, }; static void res_free(void) @@ -2269,7 +2276,7 @@ int main(int argc, char **argv, char **envp) const char *loadvm = NULL; QEMUMachine *machine; const char *cpu_model; - const char *vga_model = NULL; + const char *vga_model = "none"; const char *pid_file = NULL; const char *incoming = NULL; #ifdef CONFIG_VNC @@ -2699,6 +2706,7 @@ int main(int argc, char **argv, char **envp) break; case QEMU_OPTION_vga: vga_model = optarg; + default_vga = 0; break; case QEMU_OPTION_g: { @@ -3107,7 +3115,7 @@ int main(int argc, char **argv, char **envp) default_floppy = 0; default_cdrom = 0; default_sdcard = 0; - vga_model = "none"; + default_vga = 0; break; case QEMU_OPTION_xen_domid: if (!(xen_available())) { @@ -3468,14 +3476,13 @@ int main(int argc, char **argv, char **envp) module_call_init(MODULE_INIT_QOM); - /* must be after qdev registration but before machine init */ - if (vga_model) { - select_vgahw(vga_model); - } else if (cirrus_vga_available()) { - select_vgahw("cirrus"); - } else { - select_vgahw("none"); + /* This must be after qdev registration but before machine init. + * If no default VGA is requested, the default is "none". + */ + if (default_vga && cirrus_vga_available()) { + vga_model = "cirrus"; } + select_vgahw(vga_model); if (qemu_opts_foreach(qemu_find_opts("device"), device_help_func, NULL, 0) != 0) exit(0);