mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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>
This commit is contained in:
parent
18a1541a8d
commit
f7860455fd
2 changed files with 15 additions and 4 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue