Patchwork [2/4] skip pci_vmsvga_init() calls if CONFIG_VMWARE_VGA is disabled

login
register
mail settings
Submitter Eduardo Habkost
Date Feb. 1, 2011, 4:53 p.m.
Message ID <1296579203-21083-3-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/81348/
State New
Headers show

Comments

Eduardo Habkost - Feb. 1, 2011, 4:53 p.m.
I was planning to add the check for CONFIG_VMWARE to the command-line
parsing code in vl.c, but vl.c is not built by Makefile.target, so we
can't test for a per-target config option there.

It is not the best solution, but it is better than simply having a
CONFIG_VMWARE_VGA option that doesn't work and can't be disabled. I
don't see a good way to implement it that wouldn't involve heavily
refactoring completely the '-vga' option parsing code.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/mips_malta.c |    4 ++++
 hw/pc.c         |    4 ++++
 2 files changed, 8 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index 6be8aa7..b4164a0 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -975,7 +975,11 @@  void mips_malta_init (ram_addr_t ram_size,
     if (cirrus_vga_enabled) {
         pci_cirrus_vga_init(pci_bus);
     } else if (vmsvga_enabled) {
+#ifdef CONFIG_VMWARE_VGA
         pci_vmsvga_init(pci_bus);
+#else
+        fprintf(stderr, "%s: vmware_vga support is not compiled in\n", __FUNCTION__);
+#endif /* CONFIG_VMWARE_VGA */
     } else if (std_vga_enabled) {
         pci_vga_init(pci_bus);
     }
diff --git a/hw/pc.c b/hw/pc.c
index 119c110..e872a7b 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -987,10 +987,14 @@  void pc_vga_init(PCIBus *pci_bus)
             isa_cirrus_vga_init();
         }
     } else if (vmsvga_enabled) {
+#ifdef CONFIG_VMWARE_VGA
         if (pci_bus)
             pci_vmsvga_init(pci_bus);
         else
             fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
+#else
+        fprintf(stderr, "%s: vmware_vga support is not compiled in\n", __FUNCTION__);
+#endif /* CONFIG_VMWARE_VGA */
     } else if (std_vga_enabled) {
         if (pci_bus) {
             pci_vga_init(pci_bus);