summaryrefslogtreecommitdiff
path: root/net.h
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-17 18:06:56 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-04-17 18:06:56 +0000
commita34b6eb776fbd357fb0dfbdbfa680b4f54e12a4c (patch)
tree8bd5b118f5e89f6c2101057eb25a73bb4e1e15c4 /net.h
parent1ed3d07a22ab918037379b21e92090a7072707bf (diff)
downloadqemu-a34b6eb776fbd357fb0dfbdbfa680b4f54e12a4c.tar.gz
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/branches/stable_0_10@7160 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'net.h')
-rw-r--r--net.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/net.h b/net.h
index 03c7f1831d..a8bef3e65c 100644
--- a/net.h
+++ b/net.h
@@ -9,6 +9,7 @@ typedef ssize_t (IOReadvHandler)(void *, const struct iovec *, int);
typedef struct VLANClientState VLANClientState;
+typedef void (NetCleanup) (VLANClientState *);
typedef void (LinkStatusChanged)(VLANClientState *);
struct VLANClientState {
@@ -17,6 +18,7 @@ struct VLANClientState {
/* Packets may still be sent if this returns zero. It's used to
rate-limit the slirp code. */
IOCanRWHandler *fd_can_read;
+ NetCleanup *cleanup;
LinkStatusChanged *link_status_changed;
int link_down;
void *opaque;
@@ -40,6 +42,7 @@ VLANClientState *qemu_new_vlan_client(VLANState *vlan,
const char *name,
IOReadHandler *fd_read,
IOCanRWHandler *fd_can_read,
+ NetCleanup *cleanup,
void *opaque);
void qemu_del_vlan_client(VLANClientState *vc);
VLANClientState *qemu_find_vlan_client(VLANState *vlan, void *opaque);