[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 4/6] net: force NetQue opaque to be NetClientStat
From: |
Liu Ping Fan |
Subject: |
[Qemu-devel] [PATCH v2 4/6] net: force NetQue opaque to be NetClientState |
Date: |
Thu, 13 Jun 2013 17:03:04 +0800 |
From: Liu Ping Fan <address@hidden>
qemu_net_client_setup() is the only user of qemu_new_net_queue(), which
will pass in NetClientState. By forcing it be a NetClientState, we
can ref/unref NetQueue's owner
Signed-off-by: Liu Ping Fan <address@hidden>
---
include/net/queue.h | 2 +-
net/queue.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/net/queue.h b/include/net/queue.h
index fc02b33..ddb6d98 100644
--- a/include/net/queue.h
+++ b/include/net/queue.h
@@ -34,7 +34,7 @@ typedef void (NetPacketSent) (NetClientState *sender, ssize_t
ret);
#define QEMU_NET_PACKET_FLAG_NONE 0
#define QEMU_NET_PACKET_FLAG_RAW (1<<0)
-NetQueue *qemu_new_net_queue(void *opaque);
+NetQueue *qemu_new_net_queue(NetClientState *opaque);
void qemu_del_net_queue(NetQueue *queue);
diff --git a/net/queue.c b/net/queue.c
index 7d6c52e..58222b0 100644
--- a/net/queue.c
+++ b/net/queue.c
@@ -49,7 +49,7 @@ struct NetPacket {
};
struct NetQueue {
- void *opaque;
+ NetClientState *opaque;
uint32_t nq_maxlen;
uint32_t nq_count;
@@ -59,7 +59,7 @@ struct NetQueue {
unsigned delivering : 1;
};
-NetQueue *qemu_new_net_queue(void *opaque)
+NetQueue *qemu_new_net_queue(NetClientState *opaque)
{
NetQueue *queue;
--
1.8.1.4
[Qemu-devel] [PATCH v2 3/6] net: make netclient re-entrant with refcnt, Liu Ping Fan, 2013/06/13
[Qemu-devel] [PATCH v2 4/6] net: force NetQue opaque to be NetClientState,
Liu Ping Fan <=
[Qemu-devel] [PATCH v2 5/6] net: defer nested call to BH, Liu Ping Fan, 2013/06/13
[Qemu-devel] [PATCH v2 6/6] net: hub use lock to protect ports list, Liu Ping Fan, 2013/06/13
Re: [Qemu-devel] [PATCH v2 0/6] port network layer onto glib, Stefan Hajnoczi, 2013/06/18