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 | c7d31bd194c65076c41db3812d47e07789011ac8 (patch) | |
tree | 836a0fb70b51d1ca20f11afcae2a91f5c5ca637d /hw/etraxfs_eth.c | |
parent | 009459333db34ccdf8b85136a47a19ca49d7ee00 (diff) | |
download | qemu-c7d31bd194c65076c41db3812d47e07789011ac8.tar.gz qemu-c7d31bd194c65076c41db3812d47e07789011ac8.tar.bz2 qemu-c7d31bd194c65076c41db3812d47e07789011ac8.zip |
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/etraxfs_eth.c')
-rw-r--r-- | hw/etraxfs_eth.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/etraxfs_eth.c b/hw/etraxfs_eth.c index 58f9f4e1f4..e1e5d8cae0 100644 --- a/hw/etraxfs_eth.c +++ b/hw/etraxfs_eth.c @@ -590,9 +590,9 @@ void *etraxfs_eth_init(NICInfo *nd, target_phys_addr_t base, int phyaddr) eth->ethregs = cpu_register_io_memory(eth_read, eth_write, eth); cpu_register_physical_memory (base, 0x5c, eth->ethregs); - eth->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, - eth_can_receive, eth_receive, NULL, - eth_cleanup, eth); + eth->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, + eth_can_receive, eth_receive, + NULL, eth_cleanup, eth); eth->vc->opaque = eth; eth->vc->link_status_changed = eth_set_link; |