diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-04 11:17:51 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:39 -0600 |
commit | f79f2bfc6aae76718652f0b3e15a849f7b58104a (patch) | |
tree | be827c0b6a7ff5e2a521fd5d604773e8f079413c /hw | |
parent | 30fbb9fc7cd73abc32ff71ceb59e9a3be37ac128 (diff) | |
download | qemu-f79f2bfc6aae76718652f0b3e15a849f7b58104a.zip |
qdev: don't access name through info
We already have a QOM interface for this so let's use it.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/e1000.c | 2 | ||||
-rw-r--r-- | hw/eepro100.c | 2 | ||||
-rw-r--r-- | hw/etraxfs_eth.c | 2 | ||||
-rw-r--r-- | hw/hda-audio.c | 2 | ||||
-rw-r--r-- | hw/intel-hda.c | 2 | ||||
-rw-r--r-- | hw/lan9118.c | 2 | ||||
-rw-r--r-- | hw/milkymist-minimac2.c | 2 | ||||
-rw-r--r-- | hw/mipsnet.c | 2 | ||||
-rw-r--r-- | hw/musicpal.c | 2 | ||||
-rw-r--r-- | hw/ne2000-isa.c | 2 | ||||
-rw-r--r-- | hw/ne2000.c | 2 | ||||
-rw-r--r-- | hw/opencores_eth.c | 2 | ||||
-rw-r--r-- | hw/pci.c | 6 | ||||
-rw-r--r-- | hw/pcnet.c | 2 | ||||
-rw-r--r-- | hw/qdev-properties.c | 16 | ||||
-rw-r--r-- | hw/qdev.c | 16 | ||||
-rw-r--r-- | hw/qdev.h | 2 | ||||
-rw-r--r-- | hw/rtl8139.c | 2 | ||||
-rw-r--r-- | hw/smc91c111.c | 2 | ||||
-rw-r--r-- | hw/spapr_llan.c | 2 | ||||
-rw-r--r-- | hw/stellaris_enet.c | 2 | ||||
-rw-r--r-- | hw/usb-bus.c | 2 | ||||
-rw-r--r-- | hw/usb-net.c | 2 | ||||
-rw-r--r-- | hw/usb-ohci.c | 2 | ||||
-rw-r--r-- | hw/virtio-net.c | 2 | ||||
-rw-r--r-- | hw/xgmac.c | 2 | ||||
-rw-r--r-- | hw/xilinx_axienet.c | 2 | ||||
-rw-r--r-- | hw/xilinx_ethlite.c | 2 |
28 files changed, 44 insertions, 44 deletions
diff --git a/hw/e1000.c b/hw/e1000.c index e4362eaf92..7fc73180b1 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -1182,7 +1182,7 @@ static int pci_e1000_init(PCIDevice *pci_dev) d->eeprom_data[EEPROM_CHECKSUM_REG] = checksum; d->nic = qemu_new_nic(&net_e1000_info, &d->conf, - qdev_get_info(&d->dev.qdev)->name, d->dev.qdev.id, d); + object_get_typename(OBJECT(d)), d->dev.qdev.id, d); qemu_format_nic_info_str(&d->nic->nc, macaddr); diff --git a/hw/eepro100.c b/hw/eepro100.c index 81a32b8d7b..f0059c6ce7 100644 --- a/hw/eepro100.c +++ b/hw/eepro100.c @@ -1878,7 +1878,7 @@ static int e100_nic_init(PCIDevice *pci_dev) nic_reset(s); s->nic = qemu_new_nic(&net_eepro100_info, &s->conf, - qdev_get_info(&pci_dev->qdev)->name, pci_dev->qdev.id, s); + object_get_typename(OBJECT(pci_dev)), pci_dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); TRACE(OTHER, logout("%s\n", s->nic->nc.info_str)); diff --git a/hw/etraxfs_eth.c b/hw/etraxfs_eth.c index 5afa55fb29..1b6b71d580 100644 --- a/hw/etraxfs_eth.c +++ b/hw/etraxfs_eth.c @@ -605,7 +605,7 @@ static int fs_eth_init(SysBusDevice *dev) qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(&net_etraxfs_info, &s->conf, - dev->qdev.info->name, dev->qdev.id, s); + object_get_typename(OBJECT(s)), dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); tdk_init(&s->phy); diff --git a/hw/hda-audio.c b/hw/hda-audio.c index 0bc0a251b3..8053c74d9c 100644 --- a/hw/hda-audio.c +++ b/hw/hda-audio.c @@ -777,7 +777,7 @@ static int hda_audio_init(HDACodecDevice *hda, const struct desc_codec *desc) uint32_t i, type; a->desc = desc; - a->name = qdev_get_info(&a->hda.qdev)->name; + a->name = object_get_typename(OBJECT(a)); dprint(a, 1, "%s: cad %d\n", __FUNCTION__, a->hda.cad); AUD_register_card("hda", &a->card); diff --git a/hw/intel-hda.c b/hw/intel-hda.c index 12dcc840ea..8cb92d3ff2 100644 --- a/hw/intel-hda.c +++ b/hw/intel-hda.c @@ -1129,7 +1129,7 @@ static int intel_hda_init(PCIDevice *pci) IntelHDAState *d = DO_UPCAST(IntelHDAState, pci, pci); uint8_t *conf = d->pci.config; - d->name = qdev_get_info(&d->pci.qdev)->name; + d->name = object_get_typename(OBJECT(d)); pci_config_set_interrupt_pin(conf, 1); diff --git a/hw/lan9118.c b/hw/lan9118.c index d1b244e270..93e1896b70 100644 --- a/hw/lan9118.c +++ b/hw/lan9118.c @@ -1221,7 +1221,7 @@ static int lan9118_init1(SysBusDevice *dev) qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(&net_lan9118_info, &s->conf, - qdev_get_info(&dev->qdev)->name, dev->qdev.id, s); + object_get_typename(OBJECT(dev)), dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); s->eeprom[0] = 0xa5; for (i = 0; i < 6; i++) { diff --git a/hw/milkymist-minimac2.c b/hw/milkymist-minimac2.c index 7006d29788..107ba65e2e 100644 --- a/hw/milkymist-minimac2.c +++ b/hw/milkymist-minimac2.c @@ -479,7 +479,7 @@ static int milkymist_minimac2_init(SysBusDevice *dev) qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(&net_milkymist_minimac2_info, &s->conf, - dev->qdev.info->name, dev->qdev.id, s); + object_get_typename(OBJECT(dev)), dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); return 0; diff --git a/hw/mipsnet.c b/hw/mipsnet.c index 1486833fc0..0f80cfe43a 100644 --- a/hw/mipsnet.c +++ b/hw/mipsnet.c @@ -240,7 +240,7 @@ static int mipsnet_sysbus_init(SysBusDevice *dev) sysbus_init_irq(dev, &s->irq); s->nic = qemu_new_nic(&net_mipsnet_info, &s->conf, - qdev_get_info(&dev->qdev)->name, dev->qdev.id, s); + object_get_typename(OBJECT(dev)), dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); return 0; diff --git a/hw/musicpal.c b/hw/musicpal.c index 977ffb6e50..bca5ee9317 100644 --- a/hw/musicpal.c +++ b/hw/musicpal.c @@ -387,7 +387,7 @@ static int mv88w8618_eth_init(SysBusDevice *dev) sysbus_init_irq(dev, &s->irq); s->nic = qemu_new_nic(&net_mv88w8618_info, &s->conf, - dev->qdev.info->name, dev->qdev.id, s); + object_get_typename(OBJECT(dev)), dev->qdev.id, s); memory_region_init_io(&s->iomem, &mv88w8618_eth_ops, s, "mv88w8618-eth", MP_ETH_SIZE); sysbus_init_mmio(dev, &s->iomem); diff --git a/hw/ne2000-isa.c b/hw/ne2000-isa.c index 60dc3339b6..5bc5f2a40d 100644 --- a/hw/ne2000-isa.c +++ b/hw/ne2000-isa.c @@ -76,7 +76,7 @@ static int isa_ne2000_initfn(ISADevice *dev) ne2000_reset(s); s->nic = qemu_new_nic(&net_ne2000_isa_info, &s->c, - qdev_get_info(&dev->qdev)->name, dev->qdev.id, s); + object_get_typename(OBJECT(dev)), dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->c.macaddr.a); return 0; diff --git a/hw/ne2000.c b/hw/ne2000.c index d016b8e444..b44eab1395 100644 --- a/hw/ne2000.c +++ b/hw/ne2000.c @@ -760,7 +760,7 @@ static int pci_ne2000_init(PCIDevice *pci_dev) ne2000_reset(s); s->nic = qemu_new_nic(&net_ne2000_info, &s->c, - qdev_get_info(&pci_dev->qdev)->name, pci_dev->qdev.id, s); + object_get_typename(OBJECT(pci_dev)), pci_dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->c.macaddr.a); if (!pci_dev->qdev.hotplugged) { diff --git a/hw/opencores_eth.c b/hw/opencores_eth.c index d4d3529d71..5161b0cfc9 100644 --- a/hw/opencores_eth.c +++ b/hw/opencores_eth.c @@ -717,7 +717,7 @@ static int sysbus_open_eth_init(SysBusDevice *dev) sysbus_init_irq(dev, &s->irq); s->nic = qemu_new_nic(&net_open_eth_info, &s->conf, - qdev_get_info(&s->dev.qdev)->name, s->dev.qdev.id, s); + object_get_typename(OBJECT(s)), s->dev.qdev.id, s); return 0; } @@ -1493,7 +1493,7 @@ static int pci_qdev_init(DeviceState *qdev, DeviceInfo *base) if (pci_dev == NULL) return -1; if (qdev->hotplugged && info->no_hotplug) { - qerror_report(QERR_DEVICE_NO_HOTPLUG, info->qdev.name); + qerror_report(QERR_DEVICE_NO_HOTPLUG, object_get_typename(OBJECT(pci_dev))); do_pci_unregister_device(pci_dev); return -1; } @@ -1534,7 +1534,7 @@ static int pci_unplug_device(DeviceState *qdev) PCIDeviceInfo *info = container_of(qdev_get_info(qdev), PCIDeviceInfo, qdev); if (info->no_hotplug) { - qerror_report(QERR_DEVICE_NO_HOTPLUG, info->qdev.name); + qerror_report(QERR_DEVICE_NO_HOTPLUG, object_get_typename(OBJECT(dev))); return -1; } return dev->bus->hotplug(dev->bus->hotplug_qdev, dev, @@ -1742,7 +1742,7 @@ static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom) if (qdev_get_info(&pdev->qdev)->vmsd) snprintf(name, sizeof(name), "%s.rom", qdev_get_info(&pdev->qdev)->vmsd->name); else - snprintf(name, sizeof(name), "%s.rom", qdev_get_info(&pdev->qdev)->name); + snprintf(name, sizeof(name), "%s.rom", object_get_typename(OBJECT(pdev))); pdev->has_rom = true; memory_region_init_ram(&pdev->rom, name, size); vmstate_register_ram(&pdev->rom, &pdev->qdev); diff --git a/hw/pcnet.c b/hw/pcnet.c index 54f14ee5b4..c53f06ef3b 100644 --- a/hw/pcnet.c +++ b/hw/pcnet.c @@ -1718,7 +1718,7 @@ int pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info) s->poll_timer = qemu_new_timer_ns(vm_clock, pcnet_poll_timer, s); qemu_macaddr_default_if_unset(&s->conf.macaddr); - s->nic = qemu_new_nic(info, &s->conf, qdev_get_info(dev)->name, dev->id, s); + s->nic = qemu_new_nic(info, &s->conf, object_get_typename(OBJECT(dev)), dev->id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); add_boot_device_path(s->conf.bootindex, dev, "/ethernet-phy@0"); diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index d71dfdafaf..c98219ad26 100644 --- a/hw/qdev-properties.c +++ b/hw/qdev-properties.c @@ -989,16 +989,16 @@ void error_set_from_qdev_prop_error(Error **errp, int ret, DeviceState *dev, switch (ret) { case -EEXIST: error_set(errp, QERR_PROPERTY_VALUE_IN_USE, - qdev_get_info(dev)->name, prop->name, value); + object_get_typename(OBJECT(dev)), prop->name, value); break; default: case -EINVAL: error_set(errp, QERR_PROPERTY_VALUE_BAD, - qdev_get_info(dev)->name, prop->name, value); + object_get_typename(OBJECT(dev)), prop->name, value); break; case -ENOENT: error_set(errp, QERR_PROPERTY_VALUE_NOT_FOUND, - qdev_get_info(dev)->name, prop->name, value); + object_get_typename(OBJECT(dev)), prop->name, value); break; case 0: break; @@ -1018,7 +1018,7 @@ int qdev_prop_parse(DeviceState *dev, const char *name, const char *value) * removed along with it. */ if (!prop || !prop->info->parse) { - qerror_report(QERR_PROPERTY_NOT_FOUND, qdev_get_info(dev)->name, name); + qerror_report(QERR_PROPERTY_NOT_FOUND, object_get_typename(OBJECT(dev)), name); return -1; } ret = prop->info->parse(dev, prop, value); @@ -1039,12 +1039,12 @@ void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyT prop = qdev_prop_find(dev, name); if (!prop) { fprintf(stderr, "%s: property \"%s.%s\" not found\n", - __FUNCTION__, qdev_get_info(dev)->name, name); + __FUNCTION__, object_get_typename(OBJECT(dev)), name); abort(); } if (prop->info->type != type) { fprintf(stderr, "%s: property \"%s.%s\" type mismatch\n", - __FUNCTION__, qdev_get_info(dev)->name, name); + __FUNCTION__, object_get_typename(OBJECT(dev)), name); abort(); } qdev_prop_cpy(dev, prop, src); @@ -1093,7 +1093,7 @@ int qdev_prop_set_drive(DeviceState *dev, const char *name, BlockDriverState *va if (res < 0) { error_report("Can't attach drive %s to %s.%s: %s", bdrv_get_device_name(value), - dev->id ? dev->id : qdev_get_info(dev)->name, + dev->id ? dev->id : object_get_typename(OBJECT(dev)), name, strerror(-res)); return -1; } @@ -1165,7 +1165,7 @@ void qdev_prop_set_globals(DeviceState *dev) GlobalProperty *prop; QTAILQ_FOREACH(prop, &global_props, next) { - if (strcmp(qdev_get_info(dev)->name, prop->driver) != 0 && + if (strcmp(object_get_typename(OBJECT(dev)), prop->driver) != 0 && strcmp(qdev_get_info(dev)->bus_info->name, prop->driver) != 0) { continue; } @@ -720,7 +720,7 @@ static void qbus_list_bus(DeviceState *dev) const char *sep = " "; error_printf("child busses at \"%s\":", - dev->id ? dev->id : qdev_get_info(dev)->name); + dev->id ? dev->id : object_get_typename(OBJECT(dev))); QLIST_FOREACH(child, &dev->child_bus, sibling) { error_printf("%s\"%s\"", sep, child->name); sep = ", "; @@ -735,7 +735,7 @@ static void qbus_list_dev(BusState *bus) error_printf("devices at \"%s\":", bus->name); QTAILQ_FOREACH(dev, &bus->children, sibling) { - error_printf("%s\"%s\"", sep, qdev_get_info(dev)->name); + error_printf("%s\"%s\"", sep, object_get_typename(OBJECT(dev))); if (dev->id) error_printf("/\"%s\"", dev->id); sep = ", "; @@ -771,7 +771,7 @@ static DeviceState *qbus_find_dev(BusState *bus, char *elem) } } QTAILQ_FOREACH(dev, &bus->children, sibling) { - if (strcmp(qdev_get_info(dev)->name, elem) == 0) { + if (strcmp(object_get_typename(OBJECT(dev)), elem) == 0) { return dev; } } @@ -978,7 +978,7 @@ static void qdev_print_props(Monitor *mon, DeviceState *dev, Property *props, static void qdev_print(Monitor *mon, DeviceState *dev, int indent) { BusState *child; - qdev_printf("dev: %s, id \"%s\"\n", qdev_get_info(dev)->name, + qdev_printf("dev: %s, id \"%s\"\n", object_get_typename(OBJECT(dev)), dev->id ? dev->id : ""); indent += 2; if (dev->num_gpio_in) { @@ -1068,7 +1068,7 @@ static int qdev_get_fw_dev_path_helper(DeviceState *dev, char *p, int size) l += snprintf(p + l, size - l, "%s", d); g_free(d); } else { - l += snprintf(p + l, size - l, "%s", qdev_get_info(dev)->name); + l += snprintf(p + l, size - l, "%s", object_get_typename(OBJECT(dev))); } } l += snprintf(p + l , size - l, "/"); @@ -1090,7 +1090,7 @@ char* qdev_get_fw_dev_path(DeviceState *dev) char *qdev_get_type(DeviceState *dev, Error **errp) { - return g_strdup(qdev_get_info(dev)->name); + return g_strdup(object_get_typename(OBJECT(dev))); } void qdev_ref(DeviceState *dev) @@ -1300,7 +1300,7 @@ void qdev_property_add_child(DeviceState *dev, const char *name, { gchar *type; - type = g_strdup_printf("child<%s>", qdev_get_info(child)->name); + type = g_strdup_printf("child<%s>", object_get_typename(OBJECT(child))); qdev_property_add(dev, name, type, qdev_get_child_property, NULL, qdev_release_child_property, @@ -1352,7 +1352,7 @@ static void qdev_set_link_property(DeviceState *dev, Visitor *v, void *opaque, if (target) { gchar *target_type; - target_type = g_strdup_printf("link<%s>", qdev_get_info(target)->name); + target_type = g_strdup_printf("link<%s>", object_get_typename(OBJECT(target))); if (strcmp(target_type, type) == 0) { *child = target; qdev_ref(target); @@ -403,7 +403,7 @@ static inline const char *qdev_fw_name(DeviceState *dev) return info->alias; } - return info->name; + return object_get_typename(OBJECT(dev)); } char *qdev_get_fw_dev_path(DeviceState *dev); diff --git a/hw/rtl8139.c b/hw/rtl8139.c index 16d948ed63..2b55c7f40e 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -3478,7 +3478,7 @@ static int pci_rtl8139_init(PCIDevice *dev) s->eeprom.contents[9] = s->conf.macaddr.a[4] | s->conf.macaddr.a[5] << 8; s->nic = qemu_new_nic(&net_rtl8139_info, &s->conf, - qdev_get_info(&dev->qdev)->name, dev->qdev.id, s); + object_get_typename(OBJECT(dev)), dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); s->cplus_txbuffer = NULL; diff --git a/hw/smc91c111.c b/hw/smc91c111.c index b83a893ac3..4a68f6b8dc 100644 --- a/hw/smc91c111.c +++ b/hw/smc91c111.c @@ -752,7 +752,7 @@ static int smc91c111_init1(SysBusDevice *dev) sysbus_init_irq(dev, &s->irq); qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(&net_smc91c111_info, &s->conf, - qdev_get_info(&dev->qdev)->name, dev->qdev.id, s); + object_get_typename(OBJECT(dev)), dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); /* ??? Save/restore. */ return 0; diff --git a/hw/spapr_llan.c b/hw/spapr_llan.c index 45674c4cb9..91003cc511 100644 --- a/hw/spapr_llan.c +++ b/hw/spapr_llan.c @@ -189,7 +189,7 @@ static int spapr_vlan_init(VIOsPAPRDevice *sdev) qemu_macaddr_default_if_unset(&dev->nicconf.macaddr); dev->nic = qemu_new_nic(&net_spapr_vlan_info, &dev->nicconf, - sdev->qdev.info->name, sdev->qdev.id, dev); + object_get_typename(OBJECT(sdev)), sdev->qdev.id, dev); qemu_format_nic_info_str(&dev->nic->nc, dev->nicconf.macaddr.a); return 0; diff --git a/hw/stellaris_enet.c b/hw/stellaris_enet.c index 866c9a2381..ecd750c9b4 100644 --- a/hw/stellaris_enet.c +++ b/hw/stellaris_enet.c @@ -411,7 +411,7 @@ static int stellaris_enet_init(SysBusDevice *dev) qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(&net_stellaris_enet_info, &s->conf, - dev->qdev.info->name, dev->qdev.id, s); + object_get_typename(OBJECT(dev)), dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); stellaris_enet_reset(s); diff --git a/hw/usb-bus.c b/hw/usb-bus.c index 3b80d5efc8..9b67f18b15 100644 --- a/hw/usb-bus.c +++ b/hw/usb-bus.c @@ -250,7 +250,7 @@ int usb_claim_port(USBDevice *dev) return -1; } } else { - if (bus->nfree == 1 && strcmp(qdev_get_info(&dev->qdev)->name, "usb-hub") != 0) { + if (bus->nfree == 1 && strcmp(object_get_typename(OBJECT(dev)), "usb-hub") != 0) { /* Create a new hub and chain it on */ usb_create_simple(bus, "usb-hub"); } diff --git a/hw/usb-net.c b/hw/usb-net.c index 086aa7ee7d..fd4106b99b 100644 --- a/hw/usb-net.c +++ b/hw/usb-net.c @@ -1337,7 +1337,7 @@ static int usb_net_initfn(USBDevice *dev) qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(&net_usbnet_info, &s->conf, - qdev_get_info(&s->dev.qdev)->name, s->dev.qdev.id, s); + object_get_typename(OBJECT(s)), s->dev.qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); snprintf(s->usbstring_mac, sizeof(s->usbstring_mac), "%02x%02x%02x%02x%02x%02x", diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c index afa327414a..2df6a6ea81 100644 --- a/hw/usb-ohci.c +++ b/hw/usb-ohci.c @@ -1777,7 +1777,7 @@ static int usb_ohci_init(OHCIState *ohci, DeviceState *dev, memory_region_init_io(&ohci->mem, &ohci_mem_ops, ohci, "ohci", 256); ohci->localmem_base = localmem_base; - ohci->name = qdev_get_info(dev)->name; + ohci->name = object_get_typename(OBJECT(dev)); usb_packet_init(&ohci->usb_packet); ohci->async_td = 0; diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 6c785d0a17..bc5e3a83d1 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -1030,7 +1030,7 @@ VirtIODevice *virtio_net_init(DeviceState *dev, NICConf *conf, memcpy(&n->mac[0], &conf->macaddr, sizeof(n->mac)); n->status = VIRTIO_NET_S_LINK_UP; - n->nic = qemu_new_nic(&net_virtio_info, conf, qdev_get_info(dev)->name, dev->id, n); + n->nic = qemu_new_nic(&net_virtio_info, conf, object_get_typename(OBJECT(dev)), dev->id, n); qemu_format_nic_info_str(&n->nic->nc, conf->macaddr.a); diff --git a/hw/xgmac.c b/hw/xgmac.c index ccb9759805..ef0ca247e5 100644 --- a/hw/xgmac.c +++ b/hw/xgmac.c @@ -390,7 +390,7 @@ static int xgmac_enet_init(SysBusDevice *dev) qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(&net_xgmac_enet_info, &s->conf, - qdev_get_info(&dev->qdev)->name, dev->qdev.id, s); + object_get_typename(OBJECT(dev)), dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); s->regs[XGMAC_ADDR_HIGH(0)] = (s->conf.macaddr.a[5] << 8) | diff --git a/hw/xilinx_axienet.c b/hw/xilinx_axienet.c index a2eb3e6d5b..e713248ccb 100644 --- a/hw/xilinx_axienet.c +++ b/hw/xilinx_axienet.c @@ -856,7 +856,7 @@ static int xilinx_enet_init(SysBusDevice *dev) qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(&net_xilinx_enet_info, &s->conf, - dev->qdev.info->name, dev->qdev.id, s); + object_get_typename(OBJECT(dev)), dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); tdk_init(&s->TEMAC.phy); diff --git a/hw/xilinx_ethlite.c b/hw/xilinx_ethlite.c index 6777254f35..de595f4147 100644 --- a/hw/xilinx_ethlite.c +++ b/hw/xilinx_ethlite.c @@ -221,7 +221,7 @@ static int xilinx_ethlite_init(SysBusDevice *dev) qemu_macaddr_default_if_unset(&s->conf.macaddr); s->nic = qemu_new_nic(&net_xilinx_ethlite_info, &s->conf, - dev->qdev.info->name, dev->qdev.id, s); + object_get_typename(OBJECT(dev)), dev->qdev.id, s); qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); return 0; } |