summaryrefslogtreecommitdiffstats
path: root/include/net/net.h
diff options
context:
space:
mode:
authorJason Wang2013-01-30 12:12:27 +0100
committerAnthony Liguori2013-02-01 18:03:01 +0100
commitf7860455fd582b171e526b4b4647b9b9c9a3e703 (patch)
tree648b3fb676ff493f49fb3dddd181687777f81562 /include/net/net.h
parentnet: introduce qemu_net_client_setup() (diff)
downloadqemu-f7860455fd582b171e526b4b4647b9b9c9a3e703.tar.gz
qemu-f7860455fd582b171e526b4b4647b9b9c9a3e703.tar.xz
qemu-f7860455fd582b171e526b4b4647b9b9c9a3e703.zip
net: introduce NetClientState destructor
To allow allocating an array of NetClientState and free it once, this patch introduces destructor of NetClientState. Which could do type specific free, which could be used by multiqueue to free the array once. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'include/net/net.h')
-rw-r--r--include/net/net.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/net/net.h b/include/net/net.h
index 995df5c1ef..22adc994df 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -35,6 +35,7 @@ typedef ssize_t (NetReceive)(NetClientState *, const uint8_t *, size_t);
typedef ssize_t (NetReceiveIOV)(NetClientState *, const struct iovec *, int);
typedef void (NetCleanup) (NetClientState *);
typedef void (LinkStatusChanged)(NetClientState *);
+typedef void (NetClientDestructor)(NetClientState *);
typedef struct NetClientInfo {
NetClientOptionsKind type;
@@ -58,6 +59,7 @@ struct NetClientState {
char *name;
char info_str[256];
unsigned receive_disabled : 1;
+ NetClientDestructor *destructor;
};
typedef struct NICState {