aboutsummaryrefslogtreecommitdiff
path: root/hw/syborg_virtio.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-10-21 15:25:35 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-27 12:28:40 -0500
commit97b156213e0e38b29da4480a32d4ec33d14d3012 (patch)
tree051ed08c9332b8d80e852051176d0b28228eae03 /hw/syborg_virtio.c
parent254111ecc80501a7d5c0e82f78bfa5ca8749ae20 (diff)
virtio: use qdev properties for configuration.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/syborg_virtio.c')
-rw-r--r--hw/syborg_virtio.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/hw/syborg_virtio.c b/hw/syborg_virtio.c
index c1faf3d1a0..6cf5a15c2c 100644
--- a/hw/syborg_virtio.c
+++ b/hw/syborg_virtio.c
@@ -65,6 +65,7 @@ typedef struct {
qemu_irq irq;
uint32_t int_enable;
uint32_t id;
+ NICConf nic;
} SyborgVirtIOProxy;
static uint32_t syborg_virtio_readl(void *opaque, target_phys_addr_t offset)
@@ -273,14 +274,23 @@ static int syborg_virtio_net_init(SysBusDevice *dev)
VirtIODevice *vdev;
SyborgVirtIOProxy *proxy = FROM_SYSBUS(SyborgVirtIOProxy, dev);
- vdev = virtio_net_init(&dev->qdev);
+ vdev = virtio_net_init(&dev->qdev, &proxy->nic);
return syborg_virtio_init(proxy, vdev);
}
+static SysBusDeviceInfo syborg_virtio_net_info = {
+ .init = syborg_virtio_net_init,
+ .qdev.name = "syborg,virtio-net",
+ .qdev.size = sizeof(SyborgVirtIOProxy),
+ .qdev.props = (Property[]) {
+ DEFINE_NIC_PROPERTIES(SyborgVirtIOProxy, nic),
+ DEFINE_PROP_END_OF_LIST(),
+ }
+};
+
static void syborg_virtio_register_devices(void)
{
- sysbus_register_dev("syborg,virtio-net", sizeof(SyborgVirtIOProxy),
- syborg_virtio_net_init);
+ sysbus_register_withprop(&syborg_virtio_net_info);
}
device_init(syborg_virtio_register_devices)