qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] net: Rename send_queue to incoming_queue
@ 2013-08-02 19:47 Jan Kiszka
  2013-08-05 12:03 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2013-08-02 19:47 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 3389 bytes --]

From: Jan Kiszka <jan.kiszka@siemens.com>

Each networking client has a queue for packets that could not yet be
delivered to that client. Calling this queue "send_queue" is highly
confusing as it has nothing to to with packets send from this client but
to it. Avoid this confusing by renaming it to "incoming_queue".

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 include/net/net.h |    2 +-
 net/hub.c         |    2 +-
 net/net.c         |   14 +++++++-------
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/net/net.h b/include/net/net.h
index 30e4b04..11e1468 100644
--- a/include/net/net.h
+++ b/include/net/net.h
@@ -69,7 +69,7 @@ struct NetClientState {
     int link_down;
     QTAILQ_ENTRY(NetClientState) next;
     NetClientState *peer;
-    NetQueue *send_queue;
+    NetQueue *incoming_queue;
     char *model;
     char *name;
     char info_str[256];
diff --git a/net/hub.c b/net/hub.c
index df32074..33a99c9 100644
--- a/net/hub.c
+++ b/net/hub.c
@@ -347,7 +347,7 @@ bool net_hub_flush(NetClientState *nc)
 
     QLIST_FOREACH(port, &source_port->hub->ports, next) {
         if (port != source_port) {
-            ret += qemu_net_queue_flush(port->nc.send_queue);
+            ret += qemu_net_queue_flush(port->nc.incoming_queue);
         }
     }
     return ret ? true : false;
diff --git a/net/net.c b/net/net.c
index c0d61bf..5890e56 100644
--- a/net/net.c
+++ b/net/net.c
@@ -206,7 +206,7 @@ static void qemu_net_client_setup(NetClientState *nc,
     }
     QTAILQ_INSERT_TAIL(&net_clients, nc, next);
 
-    nc->send_queue = qemu_new_net_queue(nc);
+    nc->incoming_queue = qemu_new_net_queue(nc);
     nc->destructor = destructor;
 }
 
@@ -288,8 +288,8 @@ static void qemu_cleanup_net_client(NetClientState *nc)
 
 static void qemu_free_net_client(NetClientState *nc)
 {
-    if (nc->send_queue) {
-        qemu_del_net_queue(nc->send_queue);
+    if (nc->incoming_queue) {
+        qemu_del_net_queue(nc->incoming_queue);
     }
     if (nc->peer) {
         nc->peer->peer = NULL;
@@ -430,7 +430,7 @@ void qemu_purge_queued_packets(NetClientState *nc)
         return;
     }
 
-    qemu_net_queue_purge(nc->peer->send_queue, nc);
+    qemu_net_queue_purge(nc->peer->incoming_queue, nc);
 }
 
 void qemu_flush_queued_packets(NetClientState *nc)
@@ -443,7 +443,7 @@ void qemu_flush_queued_packets(NetClientState *nc)
         }
         return;
     }
-    if (qemu_net_queue_flush(nc->send_queue)) {
+    if (qemu_net_queue_flush(nc->incoming_queue)) {
         /* We emptied the queue successfully, signal to the IO thread to repoll
          * the file descriptor (for tap, for example).
          */
@@ -467,7 +467,7 @@ static ssize_t qemu_send_packet_async_with_flags(NetClientState *sender,
         return size;
     }
 
-    queue = sender->peer->send_queue;
+    queue = sender->peer->incoming_queue;
 
     return qemu_net_queue_send(queue, sender, flags, buf, size, sent_cb);
 }
@@ -542,7 +542,7 @@ ssize_t qemu_sendv_packet_async(NetClientState *sender,
         return iov_size(iov, iovcnt);
     }
 
-    queue = sender->peer->send_queue;
+    queue = sender->peer->incoming_queue;
 
     return qemu_net_queue_send_iov(queue, sender,
                                    QEMU_NET_PACKET_FLAG_NONE,
-- 
1.7.3.4


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 263 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] net: Rename send_queue to incoming_queue
  2013-08-02 19:47 [Qemu-devel] [PATCH] net: Rename send_queue to incoming_queue Jan Kiszka
@ 2013-08-05 12:03 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2013-08-05 12:03 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: qemu-devel, Stefan Hajnoczi

On Fri, Aug 02, 2013 at 09:47:08PM +0200, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> Each networking client has a queue for packets that could not yet be
> delivered to that client. Calling this queue "send_queue" is highly
> confusing as it has nothing to to with packets send from this client but
> to it. Avoid this confusing by renaming it to "incoming_queue".
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  include/net/net.h |    2 +-
>  net/hub.c         |    2 +-
>  net/net.c         |   14 +++++++-------
>  3 files changed, 9 insertions(+), 9 deletions(-)

Taking this for QEMU 1.7 in the net-next branch.

Thanks, applied to my net-next tree:
https://github.com/stefanha/qemu/commits/net-next

Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-05 12:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-02 19:47 [Qemu-devel] [PATCH] net: Rename send_queue to incoming_queue Jan Kiszka
2013-08-05 12:03 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).