From 40021f08882aaef93c66c8c740087b6d3031b63a Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Sun, 4 Dec 2011 12:22:06 -0600 Subject: pci: convert to QEMU Object Model Signed-off-by: Anthony Liguori --- hw/e1000.c | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) (limited to 'hw/e1000.c') diff --git a/hw/e1000.c b/hw/e1000.c index 7fc7318..200eed6 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -1197,23 +1197,32 @@ static void qdev_e1000_reset(DeviceState *dev) e1000_reset(d); } -static PCIDeviceInfo e1000_info = { - .qdev.name = "e1000", - .qdev.desc = "Intel Gigabit Ethernet", - .qdev.size = sizeof(E1000State), - .qdev.reset = qdev_e1000_reset, - .qdev.vmsd = &vmstate_e1000, - .init = pci_e1000_init, - .exit = pci_e1000_uninit, - .romfile = "pxe-e1000.rom", - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = E1000_DEVID, - .revision = 0x03, - .class_id = PCI_CLASS_NETWORK_ETHERNET, - .qdev.props = (Property[]) { - DEFINE_NIC_PROPERTIES(E1000State, conf), - DEFINE_PROP_END_OF_LIST(), - } +static Property e1000_properties[] = { + DEFINE_NIC_PROPERTIES(E1000State, conf), + DEFINE_PROP_END_OF_LIST(), +}; + +static void e1000_class_init(ObjectClass *klass, void *data) +{ + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + k->init = pci_e1000_init; + k->exit = pci_e1000_uninit; + k->romfile = "pxe-e1000.rom"; + k->vendor_id = PCI_VENDOR_ID_INTEL; + k->device_id = E1000_DEVID; + k->revision = 0x03; + k->class_id = PCI_CLASS_NETWORK_ETHERNET; +} + +static DeviceInfo e1000_info = { + .name = "e1000", + .desc = "Intel Gigabit Ethernet", + .size = sizeof(E1000State), + .reset = qdev_e1000_reset, + .vmsd = &vmstate_e1000, + .props = e1000_properties, + .class_init = e1000_class_init, }; static void e1000_register_devices(void) -- cgit v1.1