From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [6444] Handle link status in qemu_sendv_packet() (Mark McLoughlin)
Date: Mon, 26 Jan 2009 15:37:44 +0000 [thread overview]
Message-ID: <E1LRTWy-0003GM-BY@cvs.savannah.gnu.org> (raw)
Revision: 6444
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6444
Author: aliguori
Date: 2009-01-26 15:37:44 +0000 (Mon, 26 Jan 2009)
Log Message:
-----------
Handle link status in qemu_sendv_packet() (Mark McLoughlin)
If link is down, pretend that the packet has been successfully sent.
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/net.c
Modified: trunk/net.c
===================================================================
--- trunk/net.c 2009-01-26 15:37:40 UTC (rev 6443)
+++ trunk/net.c 2009-01-26 15:37:44 UTC (rev 6444)
@@ -421,6 +421,16 @@
return offset;
}
+static ssize_t calc_iov_length(const struct iovec *iov, int iovcnt)
+{
+ size_t offset = 0;
+ int i;
+
+ for (i = 0; i < iovcnt; i++)
+ offset += iov[i].iov_len;
+ return offset;
+}
+
ssize_t qemu_sendv_packet(VLANClientState *vc1, const struct iovec *iov,
int iovcnt)
{
@@ -428,12 +438,17 @@
VLANClientState *vc;
ssize_t max_len = 0;
+ if (vc1->link_down)
+ return calc_iov_length(iov, iovcnt);
+
for (vc = vlan->first_client; vc != NULL; vc = vc->next) {
ssize_t len = 0;
if (vc == vc1)
continue;
+ if (vc->link_down)
+ len = calc_iov_length(iov, iovcnt);
if (vc->fd_readv)
len = vc->fd_readv(vc->opaque, iov, iovcnt);
else if (vc->fd_read)
reply other threads:[~2009-01-26 17:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1LRTWy-0003GM-BY@cvs.savannah.gnu.org \
--to=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).