Commit c2b3b41a0ba22b22e199f0a53830f337989db9fd
1 parent
5a38f081
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> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6322 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
3 changed files
with
29 additions
and
18 deletions
hw/pc.c
@@ -852,22 +852,24 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, | @@ -852,22 +852,24 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, | ||
852 | exit(1); | 852 | exit(1); |
853 | } | 853 | } |
854 | 854 | ||
855 | - /* VGA BIOS load */ | ||
856 | - if (cirrus_vga_enabled) { | ||
857 | - snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_CIRRUS_FILENAME); | ||
858 | - } else { | ||
859 | - snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_FILENAME); | ||
860 | - } | ||
861 | - vga_bios_size = get_image_size(buf); | ||
862 | - if (vga_bios_size <= 0 || vga_bios_size > 65536) | ||
863 | - goto vga_bios_error; | ||
864 | - vga_bios_offset = qemu_ram_alloc(65536); | ||
865 | - | ||
866 | - ret = load_image(buf, phys_ram_base + vga_bios_offset); | ||
867 | - if (ret != vga_bios_size) { | ||
868 | - vga_bios_error: | ||
869 | - fprintf(stderr, "qemu: could not load VGA BIOS '%s'\n", buf); | ||
870 | - exit(1); | 855 | + if (cirrus_vga_enabled || std_vga_enabled || vmsvga_enabled) { |
856 | + /* VGA BIOS load */ | ||
857 | + if (cirrus_vga_enabled) { | ||
858 | + snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_CIRRUS_FILENAME); | ||
859 | + } else { | ||
860 | + snprintf(buf, sizeof(buf), "%s/%s", bios_dir, VGABIOS_FILENAME); | ||
861 | + } | ||
862 | + vga_bios_size = get_image_size(buf); | ||
863 | + if (vga_bios_size <= 0 || vga_bios_size > 65536) | ||
864 | + goto vga_bios_error; | ||
865 | + vga_bios_offset = qemu_ram_alloc(65536); | ||
866 | + | ||
867 | + ret = load_image(buf, phys_ram_base + vga_bios_offset); | ||
868 | + if (ret != vga_bios_size) { | ||
869 | +vga_bios_error: | ||
870 | + fprintf(stderr, "qemu: could not load VGA BIOS '%s'\n", buf); | ||
871 | + exit(1); | ||
872 | + } | ||
871 | } | 873 | } |
872 | 874 | ||
873 | /* setup basic memory access */ | 875 | /* setup basic memory access */ |
@@ -956,7 +958,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, | @@ -956,7 +958,7 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size, | ||
956 | vga_ram_addr, vga_ram_size); | 958 | vga_ram_addr, vga_ram_size); |
957 | else | 959 | else |
958 | fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__); | 960 | fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__); |
959 | - } else { | 961 | + } else if (std_vga_enabled) { |
960 | if (pci_enabled) { | 962 | if (pci_enabled) { |
961 | pci_vga_init(pci_bus, ds, phys_ram_base + vga_ram_addr, | 963 | pci_vga_init(pci_bus, ds, phys_ram_base + vga_ram_addr, |
962 | vga_ram_addr, vga_ram_size, 0, 0); | 964 | vga_ram_addr, vga_ram_size, 0, 0); |
sysemu.h
@@ -83,6 +83,7 @@ void do_info_slirp(void); | @@ -83,6 +83,7 @@ void do_info_slirp(void); | ||
83 | 83 | ||
84 | extern int bios_size; | 84 | extern int bios_size; |
85 | extern int cirrus_vga_enabled; | 85 | extern int cirrus_vga_enabled; |
86 | +extern int std_vga_enabled; | ||
86 | extern int vmsvga_enabled; | 87 | extern int vmsvga_enabled; |
87 | extern int graphic_width; | 88 | extern int graphic_width; |
88 | extern int graphic_height; | 89 | extern int graphic_height; |
vl.c
@@ -192,6 +192,7 @@ int vm_running; | @@ -192,6 +192,7 @@ int vm_running; | ||
192 | static int rtc_utc = 1; | 192 | static int rtc_utc = 1; |
193 | static int rtc_date_offset = -1; /* -1 means no change */ | 193 | static int rtc_date_offset = -1; /* -1 means no change */ |
194 | int cirrus_vga_enabled = 1; | 194 | int cirrus_vga_enabled = 1; |
195 | +int std_vga_enabled = 0; | ||
195 | int vmsvga_enabled = 0; | 196 | int vmsvga_enabled = 0; |
196 | #ifdef TARGET_SPARC | 197 | #ifdef TARGET_SPARC |
197 | int graphic_width = 1024; | 198 | int graphic_width = 1024; |
@@ -3873,7 +3874,7 @@ static void help(int exitcode) | @@ -3873,7 +3874,7 @@ static void help(int exitcode) | ||
3873 | " use -soundhw ? to get the list of supported cards\n" | 3874 | " use -soundhw ? to get the list of supported cards\n" |
3874 | " use -soundhw all to enable all of them\n" | 3875 | " use -soundhw all to enable all of them\n" |
3875 | #endif | 3876 | #endif |
3876 | - "-vga [std|cirrus|vmware]\n" | 3877 | + "-vga [std|cirrus|vmware|none]\n" |
3877 | " select video card type\n" | 3878 | " select video card type\n" |
3878 | "-localtime set the real time clock to local time [default=utc]\n" | 3879 | "-localtime set the real time clock to local time [default=utc]\n" |
3879 | "-full-screen start in full screen\n" | 3880 | "-full-screen start in full screen\n" |
@@ -4407,14 +4408,21 @@ static void select_vgahw (const char *p) | @@ -4407,14 +4408,21 @@ static void select_vgahw (const char *p) | ||
4407 | const char *opts; | 4408 | const char *opts; |
4408 | 4409 | ||
4409 | if (strstart(p, "std", &opts)) { | 4410 | if (strstart(p, "std", &opts)) { |
4411 | + std_vga_enabled = 1; | ||
4410 | cirrus_vga_enabled = 0; | 4412 | cirrus_vga_enabled = 0; |
4411 | vmsvga_enabled = 0; | 4413 | vmsvga_enabled = 0; |
4412 | } else if (strstart(p, "cirrus", &opts)) { | 4414 | } else if (strstart(p, "cirrus", &opts)) { |
4413 | cirrus_vga_enabled = 1; | 4415 | cirrus_vga_enabled = 1; |
4416 | + std_vga_enabled = 0; | ||
4414 | vmsvga_enabled = 0; | 4417 | vmsvga_enabled = 0; |
4415 | } else if (strstart(p, "vmware", &opts)) { | 4418 | } else if (strstart(p, "vmware", &opts)) { |
4416 | cirrus_vga_enabled = 0; | 4419 | cirrus_vga_enabled = 0; |
4420 | + std_vga_enabled = 0; | ||
4417 | vmsvga_enabled = 1; | 4421 | vmsvga_enabled = 1; |
4422 | + } else if (strstart(p, "none", &opts)) { | ||
4423 | + cirrus_vga_enabled = 0; | ||
4424 | + std_vga_enabled = 0; | ||
4425 | + vmsvga_enabled = 0; | ||
4418 | } else { | 4426 | } else { |
4419 | invalid_vga: | 4427 | invalid_vga: |
4420 | fprintf(stderr, "Unknown vga type: %s\n", p); | 4428 | fprintf(stderr, "Unknown vga type: %s\n", p); |