From: "Michael S. Tsirkin" <mst@redhat.com>
To: avi@redhat.com, kvm@vger.kernel.org,
virtualization@lists.linux-foundation.org
Cc: gregory.haskins@gmail.com
Subject: [PATCHv4 2/6] qemu/net: routines to get tap fd
Date: Tue, 3 Nov 2009 00:23:40 +0200 [thread overview]
Message-ID: <20091102222340.GC15153@redhat.com> (raw)
In-Reply-To: <cover.1257200517.git.mst@redhat.com>
vhost need tap fd, add API to get it from vlan client
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
net.c | 10 ++++++++++
net.h | 1 +
2 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/net.c b/net.c
index 6a7f1c2..8ac639b 100644
--- a/net.c
+++ b/net.c
@@ -1472,6 +1472,16 @@ static int tap_set_sndbuf(TAPState *s, QemuOpts *opts)
}
#endif /* TUNSETSNDBUF */
+int tap_get_fd(VLANClientState *vc)
+{
+ TAPState *s = vc->opaque;
+
+ if (vc->receive != tap_receive)
+ return -1;
+
+ return s->fd;
+}
+
int tap_has_vnet_hdr(void *opaque)
{
VLANClientState *vc = opaque;
diff --git a/net.h b/net.h
index d1ba23b..7246d16 100644
--- a/net.h
+++ b/net.h
@@ -92,6 +92,7 @@ void do_set_link(Monitor *mon, const QDict *qdict);
void do_info_usernet(Monitor *mon);
+int tap_get_fd(VLANClientState *vc);
int tap_has_vnet_hdr(void *opaque);
void tap_using_vnet_hdr(void *opaque, int using_vnet_hdr);
--
1.6.5.2.143.g8cc62
next prev parent reply other threads:[~2009-11-02 22:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1257200517.git.mst@redhat.com>
2009-11-02 22:23 ` [PATCHv4 1/6] qemu/virtio: move features to an inline function Michael S. Tsirkin
2009-11-02 22:33 ` Anthony Liguori
2009-11-03 5:08 ` Avi Kivity
2009-11-03 10:40 ` Michael S. Tsirkin
2009-11-02 22:23 ` Michael S. Tsirkin [this message]
2009-11-02 22:23 ` [PATCHv4 3/6] qemu/net: add raw backend Or Gerlitz
2009-11-02 22:24 ` [PATCHv4 4/6] qemu/net: move typedef to qemu-common.h Michael S. Tsirkin
2009-11-02 22:24 ` [PATCHv4 5/6] qemu/raw: add API to get raw socket Michael S. Tsirkin
2009-11-02 22:24 ` [PATCHv4 6/6] qemu-kvm: vhost-net implementation Michael S. Tsirkin
2009-11-05 0:22 ` Sridhar Samudrala
2009-11-05 8:23 ` Michael S. Tsirkin
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=20091102222340.GC15153@redhat.com \
--to=mst@redhat.com \
--cc=avi@redhat.com \
--cc=gregory.haskins@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.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