From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <anthony@codemonkey.ws>
Subject: [Qemu-devel] [PULL 2/4] net: Rename send_queue to incoming_queue
Date: Mon, 2 Sep 2013 13:38:31 +0200 [thread overview]
Message-ID: <1378121913-30494-3-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1378121913-30494-1-git-send-email-stefanha@redhat.com>
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>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.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 1148592..c330c9a 100644
--- a/net/net.c
+++ b/net/net.c
@@ -207,7 +207,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;
}
@@ -289,8 +289,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;
@@ -431,7 +431,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)
@@ -444,7 +444,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).
*/
@@ -468,7 +468,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);
}
@@ -543,7 +543,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.8.3.1
next prev parent reply other threads:[~2013-09-02 11:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-02 11:38 [Qemu-devel] [PULL 0/4] Net patches Stefan Hajnoczi
2013-09-02 11:38 ` [Qemu-devel] [PULL 1/4] tap: Use numbered tap/tun devices on all *BSD OS's Stefan Hajnoczi
2013-09-02 11:38 ` Stefan Hajnoczi [this message]
2013-09-02 11:38 ` [Qemu-devel] [PULL 3/4] e1000: add interrupt mitigation support Stefan Hajnoczi
2013-09-02 11:38 ` [Qemu-devel] [PULL 4/4] vmxnet3: Eliminate __packed redefined warning Stefan Hajnoczi
2013-09-05 18:38 ` [Qemu-devel] [PULL 0/4] Net patches Anthony Liguori
2013-09-06 14:59 ` Stefan Hajnoczi
2013-09-05 19:49 ` Paolo Bonzini
2013-09-05 21:02 ` Aurelien Jarno
2013-09-06 6:03 ` Paolo Bonzini
2013-09-06 14:59 ` Stefan Hajnoczi
2013-09-09 14:49 ` Aurelien Jarno
2013-09-10 7:49 ` Stefan Hajnoczi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1378121913-30494-3-git-send-email-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).