summaryrefslogtreecommitdiff
path: root/hw/virtio.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-17 17:11:08 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-17 17:11:08 +0000
commitb946a1533209f61a93e34898aebb5b43154b99c3 (patch)
tree36b0017910ca42cc5a41671b8edc7faa5da0a452 /hw/virtio.c
parent32a8f6ae93f175518f86f99249177c35d1a85114 (diff)
downloadqemu-b946a1533209f61a93e34898aebb5b43154b99c3.zip
Introduce VLANClientState::cleanup() (Mark McLoughlin)
We're currently leaking memory and file descriptors on device hot-unplug. Signed-off-by: Mark McLoughlin <markmc@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7150 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/virtio.c')
-rw-r--r--hw/virtio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/virtio.c b/hw/virtio.c
index 93a7de6899..4aa5f20a78 100644
--- a/hw/virtio.c
+++ b/hw/virtio.c
@@ -750,6 +750,13 @@ void virtio_load(VirtIODevice *vdev, QEMUFile *f)
virtio_update_irq(vdev);
}
+void virtio_cleanup(VirtIODevice *vdev)
+{
+ if (vdev->config)
+ qemu_free(vdev->config);
+ qemu_free(vdev->vq);
+}
+
VirtIODevice *virtio_init_pci(PCIBus *bus, const char *name,
uint16_t vendor, uint16_t device,
uint16_t subvendor, uint16_t subdevice,