mirror of https://github.com/xqemu/xqemu.git
ne2000_isa: make optional
Ignore failure with ne2000_isa device creation. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
60a14ad31e
commit
cd1b8a8b0d
9
hw/pc.h
9
hw/pc.h
|
@ -5,6 +5,7 @@
|
||||||
#include "ioport.h"
|
#include "ioport.h"
|
||||||
#include "isa.h"
|
#include "isa.h"
|
||||||
#include "fdc.h"
|
#include "fdc.h"
|
||||||
|
#include "net.h"
|
||||||
|
|
||||||
/* PC-style peripherals (also used by other machines). */
|
/* 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);
|
void isa_cirrus_vga_init(void);
|
||||||
|
|
||||||
/* ne2000.c */
|
/* 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;
|
ISADevice *dev;
|
||||||
|
|
||||||
qemu_check_nic_model(nd, "ne2k_isa");
|
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, "iobase", base);
|
||||||
qdev_prop_set_uint32(&dev->qdev, "irq", irq);
|
qdev_prop_set_uint32(&dev->qdev, "irq", irq);
|
||||||
qdev_set_nic_properties(&dev->qdev, nd);
|
qdev_set_nic_properties(&dev->qdev, nd);
|
||||||
qdev_init_nofail(&dev->qdev);
|
qdev_init_nofail(&dev->qdev);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* e820 types */
|
/* e820 types */
|
||||||
|
|
Loading…
Reference in New Issue