diff options
author | Mark McLoughlin <markmc@redhat.com> | 2009-07-01 16:46:38 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-07-10 17:26:03 -0500 |
commit | ed8f8da7a67999cd8b89e449b8b101f14fa16272 (patch) | |
tree | d24acffc6c1e10e6ec7924f6f318dedfbbfcc779 /hw/mipsnet.c | |
parent | 960b646371d9c91bbb908fc97ae277a384777136 (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/mipsnet.c')
-rw-r--r-- | hw/mipsnet.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/mipsnet.c b/hw/mipsnet.c index e842984219..eba60e5546 100644 --- a/hw/mipsnet.c +++ b/hw/mipsnet.c @@ -261,9 +261,10 @@ void mipsnet_init (int base, qemu_irq irq, NICInfo *nd) s->io_base = base; s->irq = irq; if (nd && nd->vlan) { - s->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, - mipsnet_receive, mipsnet_can_receive, - mipsnet_cleanup, s); + s->vc = nd->vc = qemu_new_vlan_client(nd->vlan, nd->model, nd->name, + mipsnet_receive, + mipsnet_can_receive, + mipsnet_cleanup, s); } else { s->vc = NULL; } |