mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-31 05:51:53 -06:00
Don't leak VLANClientState on PCI hot remove
destroy_nic() requires that NICInfo::private by a PCIDevice pointer, but then goes on to require that the same pointer matches VLANClientState::opaque. That is no longer the case for virtio-net since qdev and wasn't previously the case for rtl8139, ne2k_pci or eepro100. Make the situation a lot more clear by maintaining a VLANClientState pointer in NICInfo. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
d026fb6dab
commit
ae50b2747f
9 changed files with 25 additions and 27 deletions
10
hw/usb-net.c
10
hw/usb-net.c
|
@ -1458,11 +1458,11 @@ USBDevice *usb_net_init(NICInfo *nd)
|
|||
|
||||
pstrcpy(s->dev.devname, sizeof(s->dev.devname),
|
||||
"QEMU USB Network Interface");
|
||||
s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
|
||||
usbnet_can_receive,
|
||||
usbnet_receive,
|
||||
NULL,
|
||||
usbnet_cleanup, s);
|
||||
s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name,
|
||||
usbnet_can_receive,
|
||||
usbnet_receive,
|
||||
NULL,
|
||||
usbnet_cleanup, s);
|
||||
|
||||
qemu_format_nic_info_str(s->vc, s->mac);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue