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:
Mark McLoughlin 2009-07-01 16:46:38 +01:00 committed by Anthony Liguori
parent d026fb6dab
commit ae50b2747f
9 changed files with 25 additions and 27 deletions

1
net.h
View file

@ -96,6 +96,7 @@ struct NICInfo {
const char *name;
const char *devaddr;
VLANState *vlan;
VLANClientState *vc;
void *private;
int used;
int bootable;