qemu-devel
[Top][All Lists]
Advanced

[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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]