qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [6322] add a -vga none cli option (Stefano Stabellini)
Date: Thu, 15 Jan 2009 20:37:28 +0000	[thread overview]
Message-ID: <E1LNYy0-0004JC-On@cvs.savannah.gnu.org> (raw)

Revision: 6322
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6322
Author:   aliguori
Date:     2009-01-15 20:37:28 +0000 (Thu, 15 Jan 2009)

Log Message:
-----------
add a -vga none cli option (Stefano Stabellini)

currently there is no way to fully disable any graphic card device for
the PC architecture.
You can have no graphical output, thanks to -nographic, but you would
have the VGA device connected to your PCI bus anyway.
There is already a convenient -vga option to choose between std, cirrus
and vmware; this patch add the new option "none" to select no graphic
card at all.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Modified Paths:
--------------
    trunk/hw/pc.c
    trunk/sysemu.h
    trunk/vl.c

Modified: trunk/hw/pc.c
===================================================================
--- trunk/hw/pc.c	2009-01-15 20:16:51 UTC (rev 6321)
+++ trunk/hw/pc.c	2009-01-15 20:37:28 UTC (rev 6322)
@@ -852,22 +852,24 @@
         exit(1);
     }
 
-    /* VGA BIOS load */
-    if (cirrus_vga_enabled) {
-        snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_CIRRUS_FILENAME);
-    } else {
-        snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_FILENAME);
-    }
-    vga_bios_size = get_image_size(buf);
-    if (vga_bios_size <= 0 || vga_bios_size > 65536)
-        goto vga_bios_error;
-    vga_bios_offset = qemu_ram_alloc(65536);
+    if (cirrus_vga_enabled || std_vga_enabled || vmsvga_enabled) {
+        /* VGA BIOS load */
+        if (cirrus_vga_enabled) {
+            snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_CIRRUS_FILENAME);
+        } else {
+            snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_FILENAME);
+        }
+        vga_bios_size = get_image_size(buf);
+        if (vga_bios_size <= 0 || vga_bios_size > 65536)
+            goto vga_bios_error;
+        vga_bios_offset = qemu_ram_alloc(65536);
 
-    ret = load_image(buf, phys_ram_base + vga_bios_offset);
-    if (ret != vga_bios_size) {
-    vga_bios_error:
-        fprintf(stderr, "qemu: could not load VGA BIOS '%s'\n", buf);
-        exit(1);
+        ret = load_image(buf, phys_ram_base + vga_bios_offset);
+        if (ret != vga_bios_size) {
+vga_bios_error:
+            fprintf(stderr, "qemu: could not load VGA BIOS '%s'\n", buf);
+            exit(1);
+        }
     }
 
     /* setup basic memory access */
@@ -956,7 +958,7 @@
                             vga_ram_addr, vga_ram_size);
         else
             fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
-    } else {
+    } else if (std_vga_enabled) {
         if (pci_enabled) {
             pci_vga_init(pci_bus, ds, phys_ram_base + vga_ram_addr,
                          vga_ram_addr, vga_ram_size, 0, 0);

Modified: trunk/sysemu.h
===================================================================
--- trunk/sysemu.h	2009-01-15 20:16:51 UTC (rev 6321)
+++ trunk/sysemu.h	2009-01-15 20:37:28 UTC (rev 6322)
@@ -83,6 +83,7 @@
 
 extern int bios_size;
 extern int cirrus_vga_enabled;
+extern int std_vga_enabled;
 extern int vmsvga_enabled;
 extern int graphic_width;
 extern int graphic_height;

Modified: trunk/vl.c
===================================================================
--- trunk/vl.c	2009-01-15 20:16:51 UTC (rev 6321)
+++ trunk/vl.c	2009-01-15 20:37:28 UTC (rev 6322)
@@ -192,6 +192,7 @@
 static int rtc_utc = 1;
 static int rtc_date_offset = -1; /* -1 means no change */
 int cirrus_vga_enabled = 1;
+int std_vga_enabled = 0;
 int vmsvga_enabled = 0;
 #ifdef TARGET_SPARC
 int graphic_width = 1024;
@@ -3873,7 +3874,7 @@
            "                use -soundhw ? to get the list of supported cards\n"
            "                use -soundhw all to enable all of them\n"
 #endif
-           "-vga [std|cirrus|vmware]\n"
+           "-vga [std|cirrus|vmware|none]\n"
            "                select video card type\n"
            "-localtime      set the real time clock to local time [default=utc]\n"
            "-full-screen    start in full screen\n"
@@ -4407,14 +4408,21 @@
     const char *opts;
 
     if (strstart(p, "std", &opts)) {
+        std_vga_enabled = 1;
         cirrus_vga_enabled = 0;
         vmsvga_enabled = 0;
     } else if (strstart(p, "cirrus", &opts)) {
         cirrus_vga_enabled = 1;
+        std_vga_enabled = 0;
         vmsvga_enabled = 0;
     } else if (strstart(p, "vmware", &opts)) {
         cirrus_vga_enabled = 0;
+        std_vga_enabled = 0;
         vmsvga_enabled = 1;
+    } else if (strstart(p, "none", &opts)) {
+        cirrus_vga_enabled = 0;
+        std_vga_enabled = 0;
+        vmsvga_enabled = 0;
     } else {
     invalid_vga:
         fprintf(stderr, "Unknown vga type: %s\n", p);

             reply	other threads:[~2009-01-15 20:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 20:37 Anthony Liguori [this message]
2009-01-16 10:03 ` [Qemu-devel] Re: [6322] add a -vga none cli option (Stefano Stabellini) Jan Kiszka
2009-01-16 12:02   ` Stefano Stabellini
2009-01-16 18:36     ` Anthony Liguori
2009-01-16 14:27   ` Anthony Liguori
2009-01-18 21:39 ` Sebastian Herbszt
2009-01-18 23:04   ` Daniel P. Berrange
2009-01-19 12:05     ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1LNYy0-0004JC-On@cvs.savannah.gnu.org \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).