Patchwork [3/4] vga-isa: make optional

login
register
mail settings
Submitter Blue Swirl
Date Feb. 13, 2011, 9:10 p.m.
Message ID <AANLkTinkqsBgBYmAEQyfNTU-frAxA+uYy2AVmth+snvx@mail.gmail.com>
Download mbox | patch
Permalink /patch/83009/
State New
Headers show

Comments

Blue Swirl - Feb. 13, 2011, 9:10 p.m.
Ignore failure with vga-isa device creation, but print a warning
message.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/pc.h |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/pc.h b/hw/pc.h
index 475484a..60f8c42 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -183,9 +183,15 @@  extern enum vga_retrace_method vga_retrace_method;

 static inline int isa_vga_init(void)
 {
-    isa_create_simple("isa-vga");
+    ISADevice *dev;

-    return 0;
+    dev = isa_try_create("isa-vga");
+    if (!dev) {
+        fprintf(stderr, "Warning: isa-vga not available\n");
+        return 0;
+    }
+    qdev_init_nofail(&dev->qdev);
+    return 1;
 }

 int pci_vga_init(PCIBus *bus);