diff options
author | Mark McLoughlin <markmc@redhat.com> | 2009-07-01 16:46:38 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-07-09 16:58:07 -0500 |
commit | ae50b2747f77944faa79eb914272b54eb30b63b3 (patch) | |
tree | 836a0fb70b51d1ca20f11afcae2a91f5c5ca637d /hw/ne2000.c | |
parent | d026fb6dab9483869897d9d762311db8895ecca5 (diff) |
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>
Diffstat (limited to 'hw/ne2000.c')
-rw-r--r-- | hw/ne2000.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/ne2000.c b/hw/ne2000.c index 66ff29d0fc..b9c018ab2e 100644 --- a/hw/ne2000.c +++ b/hw/ne2000.c @@ -759,9 +759,9 @@ void isa_ne2000_init(int base, qemu_irq irq, NICInfo *nd) ne2000_reset(s); - s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, - ne2000_can_receive, ne2000_receive, NULL, - isa_ne2000_cleanup, s); + s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, + ne2000_can_receive, ne2000_receive, + NULL, isa_ne2000_cleanup, s); qemu_format_nic_info_str(s->vc, s->macaddr); |