From ae50b2747f77944faa79eb914272b54eb30b63b3 Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Wed, 1 Jul 2009 16:46:38 +0100 Subject: 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 Signed-off-by: Anthony Liguori --- hw/usb-net.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'hw/usb-net.c') diff --git a/hw/usb-net.c b/hw/usb-net.c index 0e80ca6923..8214a68be2 100644 --- a/hw/usb-net.c +++ b/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); -- cgit v1.2.3-55-g7522