aboutsummaryrefslogtreecommitdiff
path: root/hw/xilinx.h
diff options
context:
space:
mode:
authorPeter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>2012-09-17 13:41:39 +1000
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2012-09-19 18:48:08 +0200
commit4b5e52101f9ad077d1c016f2b7130e2fdae6d2da (patch)
tree6322be34b6d672ef28d7bac2452632da0281f256 /hw/xilinx.h
parent919f89f44c7e3a8dee6a0f0eebd0cc81766da612 (diff)
downloadqemu-4b5e52101f9ad077d1c016f2b7130e2fdae6d2da.zip
qemu-4b5e52101f9ad077d1c016f2b7130e2fdae6d2da.tar.gz
qemu-4b5e52101f9ad077d1c016f2b7130e2fdae6d2da.tar.bz2
xilinx.h: Error check when setting links
Assert that the ethernet and dma controller are sucessfully linked to their peers. Signed-off-by: Peter A. G. Crosthwaite <peter.crosthwaite@petalogix.com>
Diffstat (limited to 'hw/xilinx.h')
-rw-r--r--hw/xilinx.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/xilinx.h b/hw/xilinx.h
index 45a6bdc..4d29265 100644
--- a/hw/xilinx.h
+++ b/hw/xilinx.h
@@ -55,13 +55,16 @@ xilinx_axiethernet_create(NICInfo *nd, StreamSlave *peer,
int txmem, int rxmem)
{
DeviceState *dev;
+ Error *errp = NULL;
+
qemu_check_nic_model(nd, "xlnx.axi-ethernet");
dev = qdev_create(NULL, "xlnx.axi-ethernet");
qdev_set_nic_properties(dev, nd);
qdev_prop_set_uint32(dev, "rxmem", rxmem);
qdev_prop_set_uint32(dev, "txmem", txmem);
- object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", NULL);
+ object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp);
+ assert_no_error(errp);
qdev_init_nofail(dev);
sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);
sysbus_connect_irq(sysbus_from_qdev(dev), 0, irq);
@@ -74,8 +77,11 @@ xilinx_axiethernetdma_init(DeviceState *dev, StreamSlave *peer,
target_phys_addr_t base, qemu_irq irq,
qemu_irq irq2, int freqhz)
{
+ Error *errp = NULL;
+
qdev_prop_set_uint32(dev, "freqhz", freqhz);
- object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", NULL);
+ object_property_set_link(OBJECT(dev), OBJECT(peer), "tx_dev", &errp);
+ assert_no_error(errp);
qdev_init_nofail(dev);
sysbus_mmio_map(sysbus_from_qdev(dev), 0, base);