@@ -454,7 +454,7 @@ static void aw_emac_realize(DeviceState *dev, Error **errp)
qemu_macaddr_default_if_unset(&s->conf.macaddr);
s->nic = qemu_new_nic(&net_aw_emac_info, &s->conf,
object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
fifo8_create(&s->rx_fifo, RX_FIFO_SIZE);
fifo8_create(&s->tx_fifo[0], TX_FIFO_SIZE);
@@ -982,7 +982,7 @@ static void dp8393x_realize(DeviceState *dev, Error **errp)
s->nic = qemu_new_nic(&net_dp83932_info, &s->conf,
object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
s->watchdog = timer_new_ns(QEMU_CLOCK_VIRTUAL, dp8393x_watchdog, s);
@@ -1095,7 +1095,7 @@ mac_writereg(E1000State *s, int index, uint32_t val)
if (index == RA + 1) {
macaddr[0] = cpu_to_le32(s->mac_reg[RA]);
macaddr[1] = cpu_to_le32(s->mac_reg[RA + 1]);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), (uint8_t *)macaddr);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), (uint8_t *)macaddr);
}
}
@@ -1711,7 +1711,7 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error **errp)
d->nic = qemu_new_nic(&net_e1000_info, &d->conf,
object_get_typename(OBJECT(d)), dev->id, d);
- qemu_format_nic_info_str(qemu_get_queue(d->nic), macaddr);
+ qemu_update_nic_macaddr(qemu_get_queue(d->nic), macaddr);
d->autoneg_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL, e1000_autoneg_timer, d);
d->mit_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, e1000_mit_timer, d);
@@ -333,7 +333,7 @@ e1000e_init_net_peer(E1000EState *s, PCIDevice *pci_dev, uint8_t *macaddr)
trace_e1000e_mac_set_permanent(MAC_ARG(macaddr));
memcpy(s->core.permanent_mac, macaddr, sizeof(s->core.permanent_mac));
- qemu_format_nic_info_str(qemu_get_queue(s->nic), macaddr);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), macaddr);
/* Setup virtio headers */
if (s->disable_vnet) {
@@ -2731,7 +2731,7 @@ e1000e_mac_setmacaddr(E1000ECore *core, int index, uint32_t val)
macaddr[0] = cpu_to_le32(core->mac[RA]);
macaddr[1] = cpu_to_le32(core->mac[RA + 1]);
- qemu_format_nic_info_str(qemu_get_queue(core->owner_nic),
+ qemu_update_nic_macaddr(qemu_get_queue(core->owner_nic),
(uint8_t *) macaddr);
trace_e1000e_mac_set_sw(MAC_ARG(macaddr));
@@ -145,7 +145,7 @@ void e1000x_reset_mac_addr(NICState *nic, uint32_t *mac_regs,
(i < 2) ? mac_addr[i + 4] << (8 * i) : 0;
}
- qemu_format_nic_info_str(qemu_get_queue(nic), mac_addr);
+ qemu_update_nic_macaddr(qemu_get_queue(nic), mac_addr);
trace_e1000x_mac_indicate(MAC_ARG(mac_addr));
}
@@ -1867,8 +1867,9 @@ static void e100_nic_realize(PCIDevice *pci_dev, Error **errp)
s->nic = qemu_new_nic(&net_eepro100_info, &s->conf,
object_get_typename(OBJECT(pci_dev)), pci_dev->qdev.id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
- TRACE(OTHER, logout("%s\n", qemu_get_queue(s->nic)->info_str));
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ TRACE(OTHER, logout("macaddr=%s\n",
+ qemu_get_queue(s->nic)->stored_config->u.nic.macaddr));
qemu_register_reset(nic_reset, s);
@@ -620,7 +620,7 @@ static void etraxfs_eth_realize(DeviceState *dev, Error **errp)
qemu_macaddr_default_if_unset(&s->conf.macaddr);
s->nic = qemu_new_nic(&net_etraxfs_info, &s->conf,
object_get_typename(OBJECT(s)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
s->phy.read = tdk_read;
s->phy.write = tdk_write;
@@ -390,7 +390,7 @@ static void etsec_realize(DeviceState *dev, Error **errp)
etsec->nic = qemu_new_nic(&net_etsec_info, &etsec->conf,
object_get_typename(OBJECT(dev)), dev->id, etsec);
- qemu_format_nic_info_str(qemu_get_queue(etsec->nic), etsec->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(etsec->nic), etsec->conf.macaddr.a);
etsec->ptimer = ptimer_init(etsec_timer_hit, etsec, PTIMER_POLICY_DEFAULT);
ptimer_transaction_begin(etsec->ptimer);
@@ -1037,7 +1037,7 @@ static void ftgmac100_realize(DeviceState *dev, Error **errp)
s->nic = qemu_new_nic(&net_ftgmac100_info, &s->conf,
object_get_typename(OBJECT(dev)), DEVICE(dev)->id,
s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
}
static const VMStateDescription vmstate_ftgmac100 = {
@@ -174,8 +174,8 @@ static void set_individual_address(I82596State *s, uint32_t addr)
m = s->conf.macaddr.a;
address_space_read(&address_space_memory, addr + 8,
MEMTXATTRS_UNSPECIFIED, m, ETH_ALEN);
- qemu_format_nic_info_str(nc, m);
- trace_i82596_new_mac(nc->info_str);
+ qemu_update_nic_macaddr(nc, m);
+ trace_i82596_new_mac(nc->stored_config->u.nic.macaddr);
}
static void set_multicast_list(I82596State *s, uint32_t addr)
@@ -723,7 +723,7 @@ void i82596_common_init(DeviceState *dev, I82596State *s, NetClientInfo *info)
}
s->nic = qemu_new_nic(info, &s->conf, object_get_typename(OBJECT(dev)),
dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
if (USE_TIMER) {
s->flush_queue_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL,
@@ -1323,7 +1323,7 @@ static void imx_eth_realize(DeviceState *dev, Error **errp)
object_get_typename(OBJECT(dev)),
DEVICE(dev)->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
}
static Property imx_eth_properties[] = {
@@ -353,7 +353,7 @@ static void lan9118_update(lan9118_state *s)
static void lan9118_mac_changed(lan9118_state *s)
{
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
}
static void lan9118_reload_eeprom(lan9118_state *s)
@@ -1343,7 +1343,7 @@ static void lan9118_realize(DeviceState *dev, Error **errp)
s->nic = qemu_new_nic(&net_lan9118_info, &s->conf,
object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
s->eeprom[0] = 0xa5;
for (i = 0; i < 6; i++) {
s->eeprom[i + 1] = s->conf.macaddr.a[i];
@@ -641,7 +641,7 @@ static void mcf_fec_realize(DeviceState *dev, Error **errp)
s->nic = qemu_new_nic(&net_mcf_fec_info, &s->conf,
object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
}
static void mcf_fec_instance_init(Object *obj)
@@ -485,7 +485,7 @@ static void milkymist_minimac2_realize(DeviceState *dev, Error **errp)
qemu_macaddr_default_if_unset(&s->conf.macaddr);
s->nic = qemu_new_nic(&net_milkymist_minimac2_info, &s->conf,
object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
}
static const VMStateDescription vmstate_milkymist_minimac2_mdio = {
@@ -255,7 +255,7 @@ static void mipsnet_realize(DeviceState *dev, Error **errp)
s->nic = qemu_new_nic(&net_mipsnet_info, &s->conf,
object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
}
static void mipsnet_sysbus_reset(DeviceState *dev)
@@ -74,7 +74,7 @@ static void isa_ne2000_realizefn(DeviceState *dev, Error **errp)
s->nic = qemu_new_nic(&net_ne2000_isa_info, &s->c,
object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->c.macaddr.a);
}
static Property ne2000_isa_properties[] = {
@@ -72,7 +72,7 @@ static void pci_ne2000_realize(PCIDevice *pci_dev, Error **errp)
s->nic = qemu_new_nic(&net_ne2000_info, &s->c,
object_get_typename(OBJECT(pci_dev)),
pci_dev->qdev.id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->c.macaddr.a);
}
static void pci_ne2000_exit(PCIDevice *pci_dev)
@@ -1719,7 +1719,7 @@ void pcnet_common_init(DeviceState *dev, PCNetState *s, NetClientInfo *info)
qemu_macaddr_default_if_unset(&s->conf.macaddr);
s->nic = qemu_new_nic(info, &s->conf, object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
/* Initialize the PROM */
@@ -240,8 +240,8 @@ FpPort *fp_port_alloc(Rocker *r, char *sw_name,
port->nic = qemu_new_nic(&fp_port_info, &port->conf,
sw_name, NULL, port);
- qemu_format_nic_info_str(qemu_get_queue(port->nic),
- port->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(port->nic),
+ port->conf.macaddr.a);
fp_port_reset(port);
@@ -1227,7 +1227,7 @@ static void rtl8139_reset(DeviceState *d)
/* restore MAC address */
memcpy(s->phys, s->conf.macaddr.a, 6);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->phys);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->phys);
/* reset interrupt mask */
s->IntrStatus = 0;
@@ -2676,7 +2676,7 @@ static void rtl8139_io_writeb(void *opaque, uint8_t addr, uint32_t val)
break;
case MAC0+5:
s->phys[addr - MAC0] = val;
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->phys);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->phys);
break;
case MAC0+6 ... MAC0+7:
/* reserved */
@@ -3398,7 +3398,7 @@ static void pci_rtl8139_realize(PCIDevice *dev, Error **errp)
s->nic = qemu_new_nic(&net_rtl8139_info, &s->conf,
object_get_typename(OBJECT(dev)), d->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
s->cplus_txbuffer = NULL;
s->cplus_txbuffer_len = 0;
@@ -782,7 +782,7 @@ static void smc91c111_realize(DeviceState *dev, Error **errp)
qemu_macaddr_default_if_unset(&s->conf.macaddr);
s->nic = qemu_new_nic(&net_smc91c111_info, &s->conf,
object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
/* ??? Save/restore. */
}
@@ -314,7 +314,7 @@ static void spapr_vlan_reset(SpaprVioDevice *sdev)
memcpy(&dev->nicconf.macaddr.a, &dev->perm_mac.a,
sizeof(dev->nicconf.macaddr.a));
- qemu_format_nic_info_str(qemu_get_queue(dev->nic), dev->nicconf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(dev->nic), dev->nicconf.macaddr.a);
}
static void spapr_vlan_realize(SpaprVioDevice *sdev, Error **errp)
@@ -327,7 +327,7 @@ static void spapr_vlan_realize(SpaprVioDevice *sdev, Error **errp)
dev->nic = qemu_new_nic(&net_spapr_vlan_info, &dev->nicconf,
object_get_typename(OBJECT(sdev)), sdev->qdev.id, dev);
- qemu_format_nic_info_str(qemu_get_queue(dev->nic), dev->nicconf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(dev->nic), dev->nicconf.macaddr.a);
dev->rxp_timer = timer_new_us(QEMU_CLOCK_VIRTUAL, spapr_vlan_flush_rx_queue,
dev);
@@ -775,7 +775,7 @@ static target_ulong h_change_logical_lan_mac(PowerPCCPU *cpu,
macaddr >>= 8;
}
- qemu_format_nic_info_str(qemu_get_queue(dev->nic), dev->nicconf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(dev->nic), dev->nicconf.macaddr.a);
return H_SUCCESS;
}
@@ -493,7 +493,7 @@ static void stellaris_enet_realize(DeviceState *dev, Error **errp)
s->nic = qemu_new_nic(&net_stellaris_enet_info, &s->conf,
object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
}
static Property stellaris_enet_properties[] = {
@@ -1361,8 +1361,8 @@ static void sungem_realize(PCIDevice *pci_dev, Error **errp)
s->nic = qemu_new_nic(&net_sungem_info, &s->conf,
object_get_typename(OBJECT(dev)),
dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic),
- s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic),
+ s->conf.macaddr.a);
}
static void sungem_reset(DeviceState *dev)
@@ -892,7 +892,7 @@ static void sunhme_realize(PCIDevice *pci_dev, Error **errp)
qemu_macaddr_default_if_unset(&s->conf.macaddr);
s->nic = qemu_new_nic(&net_sunhme_info, &s->conf,
object_get_typename(OBJECT(d)), d->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
}
static void sunhme_instance_init(Object *obj)
@@ -964,7 +964,7 @@ static void pci_tulip_realize(PCIDevice *pci_dev, Error **errp)
s->nic = qemu_new_nic(&net_tulip_info, &s->c,
object_get_typename(OBJECT(pci_dev)),
pci_dev->qdev.id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->c.macaddr.a);
}
static void pci_tulip_exit(PCIDevice *pci_dev)
@@ -152,7 +152,7 @@ static void virtio_net_set_config(VirtIODevice *vdev, const uint8_t *config)
!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1) &&
memcmp(netcfg.mac, n->mac, ETH_ALEN)) {
memcpy(n->mac, netcfg.mac, ETH_ALEN);
- qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac);
+ qemu_update_nic_macaddr(qemu_get_queue(n->nic), n->mac);
}
}
@@ -521,7 +521,7 @@ static void virtio_net_reset(VirtIODevice *vdev)
n->mac_table.uni_overflow = 0;
memset(n->mac_table.macs, 0, MAC_TABLE_ENTRIES * ETH_ALEN);
memcpy(&n->mac[0], &n->nic->conf->macaddr, sizeof(n->mac));
- qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac);
+ qemu_update_nic_macaddr(qemu_get_queue(n->nic), n->mac);
memset(n->vlans, 0, MAX_VLAN >> 3);
/* Flush any async TX */
@@ -1009,7 +1009,7 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t cmd,
}
s = iov_to_buf(iov, iov_cnt, 0, &n->mac, sizeof(n->mac));
assert(s == sizeof(n->mac));
- qemu_format_nic_info_str(qemu_get_queue(n->nic), n->mac);
+ qemu_update_nic_macaddr(qemu_get_queue(n->nic), n->mac);
rxfilter_notify(nc);
return VIRTIO_NET_OK;
@@ -3056,7 +3056,7 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
n->host_hdr_len = 0;
}
- qemu_format_nic_info_str(qemu_get_queue(n->nic), n->nic_conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(n->nic), n->nic_conf.macaddr.a);
n->vqs[0].tx_waiting = 0;
n->tx_burst = n->net_conf.txburst;
@@ -366,7 +366,7 @@ static void vmxnet3_set_variable_mac(VMXNET3State *s, uint32_t h, uint32_t l)
VMW_CFPRN("Variable MAC: " MAC_FMT, MAC_ARG(s->conf.macaddr.a));
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
}
static uint64_t vmxnet3_get_mac_low(MACAddr *addr)
@@ -2069,7 +2069,7 @@ static void vmxnet3_net_init(VMXNET3State *s)
qemu_using_vnet_hdr(qemu_get_queue(s->nic)->peer, 1);
}
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
}
static void
@@ -296,10 +296,6 @@ static int net_init(struct XenLegacyDevice *xendev)
netdev->nic = qemu_new_nic(&net_xen_info, &netdev->conf,
"xen", NULL, netdev);
- snprintf(qemu_get_queue(netdev->nic)->info_str,
- sizeof(qemu_get_queue(netdev->nic)->info_str),
- "nic: xenbus vif macaddr=%s", netdev->mac);
-
/* fill info */
xenstore_write_be_int(&netdev->xendev, "feature-rx-copy", 1);
xenstore_write_be_int(&netdev->xendev, "feature-rx-flip", 0);
@@ -393,7 +393,7 @@ static void xgmac_enet_realize(DeviceState *dev, Error **errp)
qemu_macaddr_default_if_unset(&s->conf.macaddr);
s->nic = qemu_new_nic(&net_xgmac_enet_info, &s->conf,
object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
s->regs[XGMAC_ADDR_HIGH(0)] = (s->conf.macaddr.a[5] << 8) |
s->conf.macaddr.a[4];
@@ -975,7 +975,7 @@ static void xilinx_enet_realize(DeviceState *dev, Error **errp)
qemu_macaddr_default_if_unset(&s->conf.macaddr);
s->nic = qemu_new_nic(&net_xilinx_enet_info, &s->conf,
object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
tdk_init(&s->TEMAC.phy);
mdio_attach(&s->TEMAC.mdio_bus, &s->TEMAC.phy, s->c_phyaddr);
@@ -235,7 +235,7 @@ static void xilinx_ethlite_realize(DeviceState *dev, Error **errp)
qemu_macaddr_default_if_unset(&s->conf.macaddr);
s->nic = qemu_new_nic(&net_xilinx_ethlite_info, &s->conf,
object_get_typename(OBJECT(dev)), dev->id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
}
static void xilinx_ethlite_init(Object *obj)
@@ -1362,7 +1362,7 @@ static void usb_net_realize(USBDevice *dev, Error **errp)
qemu_macaddr_default_if_unset(&s->conf.macaddr);
s->nic = qemu_new_nic(&net_usbnet_info, &s->conf,
object_get_typename(OBJECT(s)), s->dev.qdev.id, s);
- qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
+ qemu_update_nic_macaddr(qemu_get_queue(s->nic), s->conf.macaddr.a);
snprintf(s->usbstring_mac, sizeof(s->usbstring_mac),
"%02x%02x%02x%02x%02x%02x",
0x40,
@@ -91,7 +91,6 @@ struct NetClientState {
NetQueue *incoming_queue;
char *model;
char *name;
- char info_str[256];
NetdevInfo *stored_config;
unsigned receive_disabled : 1;
NetClientDestructor *destructor;
@@ -155,7 +154,7 @@ ssize_t qemu_send_packet_async(NetClientState *nc, const uint8_t *buf,
void qemu_purge_queued_packets(NetClientState *nc);
void qemu_flush_queued_packets(NetClientState *nc);
void qemu_flush_or_purge_queued_packets(NetClientState *nc, bool purge);
-void qemu_format_nic_info_str(NetClientState *nc, uint8_t macaddr[6]);
+void qemu_update_nic_macaddr(NetClientState *nc, uint8_t macaddr[6]);
bool qemu_has_ufo(NetClientState *nc);
bool qemu_has_vnet_hdr(NetClientState *nc);
bool qemu_has_vnet_hdr_len(NetClientState *nc, int len);
@@ -744,9 +744,6 @@ int net_init_l2tpv3(const Netdev *netdev,
if (l2tpv3->has_dstport) {
stored->dstport = g_strdup(l2tpv3->dstport);
}
-
- snprintf(s->nc.info_str, sizeof(s->nc.info_str),
- "l2tpv3: connected");
return 0;
outerr:
qemu_del_net_client(nc);
@@ -127,19 +127,13 @@ char *qemu_mac_strdup_printf(const uint8_t *macaddr)
macaddr[3], macaddr[4], macaddr[5]);
}
-void qemu_format_nic_info_str(NetClientState *nc, uint8_t macaddr[6])
+void qemu_update_nic_macaddr(NetClientState *nc, uint8_t macaddr[6])
{
g_assert(nc->stored_config);
g_free(nc->stored_config->u.nic.macaddr);
nc->stored_config->u.nic.macaddr = g_strdup_printf(MAC_FMT,
MAC_ARG(macaddr));
-
- snprintf(nc->info_str, sizeof(nc->info_str),
- "model=%s,macaddr=%02x:%02x:%02x:%02x:%02x:%02x",
- nc->model,
- macaddr[0], macaddr[1], macaddr[2],
- macaddr[3], macaddr[4], macaddr[5]);
}
static int mac_table[256] = {0};
@@ -670,10 +670,6 @@ static int net_slirp_init(NetClientState *peer, const char *model,
stored->tftp_server_name = g_strdup(tftp_server_name);
}
- snprintf(nc->info_str, sizeof(nc->info_str),
- "net=%s,restrict=%s", inet_ntoa(net),
- restricted ? "on" : "off");
-
s = DO_UPCAST(SlirpState, nc, nc);
s->slirp = slirp_init(restricted, ipv4, net, mask, host,
@@ -180,7 +180,6 @@ static void net_socket_send(void *opaque)
s->fd = -1;
net_socket_rs_init(&s->rs, net_socket_rs_finalize, false);
s->nc.link_down = true;
- memset(s->nc.info_str, 0, sizeof(s->nc.info_str));
return;
}
@@ -400,16 +399,10 @@ static NetSocketState *net_socket_fd_init_dgram(NetClientState *peer,
stored->mcast = g_strdup(mcast);
s->dgram_dst = saddr;
- snprintf(nc->info_str, sizeof(nc->info_str),
- "socket: fd=%d (cloned mcast=%s:%d)",
- fd, inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port));
} else {
if (sa_type == SOCKET_ADDRESS_TYPE_UNIX) {
s->dgram_dst.sin_family = AF_UNIX;
}
-
- snprintf(nc->info_str, sizeof(nc->info_str),
- "socket: fd=%d %s", fd, SocketAddressType_str(sa_type));
}
return s;
@@ -443,9 +436,6 @@ static NetSocketState *net_socket_fd_init_stream(NetClientState *peer,
NetdevSocketOptions *stored;
nc = qemu_new_net_client(&net_socket_info, peer, model, name);
-
- snprintf(nc->info_str, sizeof(nc->info_str), "socket: fd=%d", fd);
-
s = DO_UPCAST(NetSocketState, nc, nc);
s->fd = fd;
@@ -527,10 +517,6 @@ static void net_socket_accept(void *opaque)
stored->has_fd = true;
stored->fd = g_strdup_printf("%d", fd);
-
- snprintf(s->nc.info_str, sizeof(s->nc.info_str),
- "socket: connection from %s:%d",
- inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port));
}
static int net_socket_listen_init(NetClientState *peer,
@@ -645,9 +631,6 @@ static int net_socket_connect_init(NetClientState *peer,
stored->has_connect = true;
stored->connect = g_strdup(host_str);
- snprintf(s->nc.info_str, sizeof(s->nc.info_str),
- "socket: connect to %s:%d",
- inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port));
return 0;
}
@@ -704,11 +687,7 @@ static int net_socket_mcast_init(NetClientState *peer,
stored->localaddr = g_strdup(localaddr_str);
}
- snprintf(s->nc.info_str, sizeof(s->nc.info_str),
- "socket: mcast=%s:%d",
- inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port));
return 0;
-
}
static int net_socket_udp_init(NetClientState *peer,
@@ -769,9 +748,6 @@ static int net_socket_udp_init(NetClientState *peer,
stored->has_udp = true;
stored->udp = g_strdup(rhost);
- snprintf(s->nc.info_str, sizeof(s->nc.info_str),
- "socket: udp=%s:%d",
- inet_ntoa(raddr.sin_addr), ntohs(raddr.sin_port));
return 0;
}
@@ -616,9 +616,6 @@ int net_init_bridge(const Netdev *netdev, const char *name,
stored->helper = g_strdup(helper);
}
- snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s,br=%s", helper,
- br);
-
return 0;
}
@@ -704,8 +701,6 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
stored->fds = g_strdup_printf("%s:%d", stored->fds, fd);
g_free(tmp_s);
}
-
- snprintf(s->nc.info_str, sizeof(s->nc.info_str), "fd=%d", fd);
} else if (tap->has_helper) {
if (!stored->has_helper) {
stored->has_helper = true;
@@ -717,9 +712,6 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
stored->br = tap->has_br ? g_strdup(tap->br) :
g_strdup(DEFAULT_BRIDGE_INTERFACE);
}
-
- snprintf(s->nc.info_str, sizeof(s->nc.info_str), "helper=%s",
- tap->helper);
} else {
if (ifname && !stored->has_ifname) {
stored->has_ifname = true;
@@ -736,10 +728,6 @@ static void net_init_tap_one(const NetdevTapOptions *tap, NetClientState *peer,
stored->downscript = g_strdup(downscript);
}
- snprintf(s->nc.info_str, sizeof(s->nc.info_str),
- "ifname=%s,script=%s,downscript=%s", ifname, script,
- downscript);
-
if (strcmp(downscript, "no") != 0) {
snprintf(s->down_script, sizeof(s->down_script), "%s", downscript);
snprintf(s->down_script_arg, sizeof(s->down_script_arg),
@@ -99,10 +99,6 @@ static int net_vde_init(NetClientState *peer, const char *model,
}
nc = qemu_new_net_client(&net_vde_info, peer, model, name);
-
- snprintf(nc->info_str, sizeof(nc->info_str), "sock=%s,fd=%d",
- sock, vde_datafd(vde));
-
s = DO_UPCAST(VDEState, nc, nc);
s->vde = vde;
@@ -323,8 +323,6 @@ static int net_vhost_user_init(NetClientState *peer, const char *device,
user = g_new0(struct VhostUserState, 1);
for (i = 0; i < queues; i++) {
nc = qemu_new_net_client(&net_vhost_user_info, peer, device, name);
- snprintf(nc->info_str, sizeof(nc->info_str), "vhost-user%d to %s",
- i, chr->label);
nc->queue_index = i;
if (!nc0) {
nc0 = nc;
Completely remove the info_str field of struct NetClientState because it is no longer required due to the addition of the QMP query-netdevs command. Signed-off-by: Alexey Kirillov <lekiravi@yandex-team.ru> --- hw/net/allwinner_emac.c | 2 +- hw/net/dp8393x.c | 2 +- hw/net/e1000.c | 4 ++-- hw/net/e1000e.c | 2 +- hw/net/e1000e_core.c | 2 +- hw/net/e1000x_common.c | 2 +- hw/net/eepro100.c | 5 +++-- hw/net/etraxfs_eth.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/ftgmac100.c | 2 +- hw/net/i82596.c | 6 +++--- hw/net/imx_fec.c | 2 +- hw/net/lan9118.c | 4 ++-- hw/net/mcf_fec.c | 2 +- hw/net/milkymist-minimac2.c | 2 +- hw/net/mipsnet.c | 2 +- hw/net/ne2000-isa.c | 2 +- hw/net/ne2000-pci.c | 2 +- hw/net/pcnet.c | 2 +- hw/net/rocker/rocker_fp.c | 4 ++-- hw/net/rtl8139.c | 6 +++--- hw/net/smc91c111.c | 2 +- hw/net/spapr_llan.c | 6 +++--- hw/net/stellaris_enet.c | 2 +- hw/net/sungem.c | 4 ++-- hw/net/sunhme.c | 2 +- hw/net/tulip.c | 2 +- hw/net/virtio-net.c | 8 ++++---- hw/net/vmxnet3.c | 4 ++-- hw/net/xen_nic.c | 4 ---- hw/net/xgmac.c | 2 +- hw/net/xilinx_axienet.c | 2 +- hw/net/xilinx_ethlite.c | 2 +- hw/usb/dev-network.c | 2 +- include/net/net.h | 3 +-- net/l2tpv3.c | 3 --- net/net.c | 8 +------- net/slirp.c | 4 ---- net/socket.c | 24 ------------------------ net/tap.c | 12 ------------ net/vde.c | 4 ---- net/vhost-user.c | 2 -- 42 files changed, 51 insertions(+), 110 deletions(-)