From: Pierre Riteau <Pierre.Riteau@irisa.fr>
To: qemu-devel@nongnu.org, Mark McLoughlin <markmc@redhat.com>
Cc: Pierre Riteau <Pierre.Riteau@irisa.fr>
Subject: [Qemu-devel] [PATCH] Check for TUNSETOFFLOAD support before trying to enable offload features
Date: Wed, 25 Nov 2009 11:04:42 +0100 [thread overview]
Message-ID: <1259143482-17735-1-git-send-email-Pierre.Riteau@irisa.fr> (raw)
This avoids the "TUNSETOFFLOAD ioctl() failed: Invalid argument" message
on kernels without TUNSETOFFLOAD support.
Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr>
---
net/tap-linux.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/net/tap-linux.c b/net/tap-linux.c
index 0f621a2..e038e1a 100644
--- a/net/tap-linux.c
+++ b/net/tap-linux.c
@@ -129,6 +129,11 @@ void tap_fd_set_offload(int fd, int csum, int tso4,
{
unsigned int offload = 0;
+ /* Check if our kernel supports TUNSETOFFLOAD */
+ if (ioctl(fd, TUNSETOFFLOAD, 0) != 0 && errno == EINVAL) {
+ return;
+ }
+
if (csum) {
offload |= TUN_F_CSUM;
if (tso4)
--
1.6.5
next reply other threads:[~2009-11-25 10:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-25 10:04 Pierre Riteau [this message]
2009-11-25 10:08 ` [Qemu-devel] [PATCH] Check for TUNSETOFFLOAD support before trying to enable offload features Mark McLoughlin
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=1259143482-17735-1-git-send-email-Pierre.Riteau@irisa.fr \
--to=pierre.riteau@irisa.fr \
--cc=markmc@redhat.com \
--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).