qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 04/10] ne2000_isa: make optional
@ 2011-02-12 22:41 Blue Swirl
  0 siblings, 0 replies; only message in thread
From: Blue Swirl @ 2011-02-12 22:41 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]

Ignore failure with ne2000_isa device creation.

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

diff --git a/hw/pc.h b/hw/pc.h
index abdf307..50d9943 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -5,6 +5,7 @@
 #include "ioport.h"
 #include "isa.h"
 #include "fdc.h"
+#include "net.h"

 /* PC-style peripherals (also used by other machines).  */

@@ -176,17 +177,21 @@ void pci_cirrus_vga_init(PCIBus *bus);
 void isa_cirrus_vga_init(void);

 /* ne2000.c */
-static inline void isa_ne2000_init(int base, int irq, NICInfo *nd)
+static inline bool isa_ne2000_init(int base, int irq, NICInfo *nd)
 {
     ISADevice *dev;

     qemu_check_nic_model(nd, "ne2k_isa");

-    dev = isa_create("ne2k_isa");
+    dev = isa_try_create("ne2k_isa");
+    if (!dev) {
+        return false;
+    }
     qdev_prop_set_uint32(&dev->qdev, "iobase", base);
     qdev_prop_set_uint32(&dev->qdev, "irq",    irq);
     qdev_set_nic_properties(&dev->qdev, nd);
     qdev_init_nofail(&dev->qdev);
+    return true;
 }

 /* e820 types */
-- 
1.6.2.4

[-- Attachment #2: 0004-ne2000_isa-make-optional.patch --]
[-- Type: application/mbox, Size: 1579 bytes --]

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-02-12 22:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-12 22:41 [Qemu-devel] [PATCH 04/10] ne2000_isa: make optional Blue Swirl

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).