summaryrefslogtreecommitdiff
path: root/net/tap.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2010-03-17 13:07:50 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-04-01 13:56:43 -0500
commit131f10cdcf17dc6155aed240618a5f286d6ca06f (patch)
tree11c937b0f1f5e7810b82b8c00b626393be862f0c /net/tap.c
parentb3be297b9c658fbb7c1e89be232852d01a96848b (diff)
downloadqemu-131f10cdcf17dc6155aed240618a5f286d6ca06f.tar.gz
qemu-131f10cdcf17dc6155aed240618a5f286d6ca06f.tar.bz2
qemu-131f10cdcf17dc6155aed240618a5f286d6ca06f.zip
tap: add interface to get device fd
Will be used by vhost to attach/detach to backend. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net/tap.c')
-rw-r--r--net/tap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/tap.c b/net/tap.c
index 672b0ee0b4..c19740b584 100644
--- a/net/tap.c
+++ b/net/tap.c
@@ -270,6 +270,13 @@ static void tap_poll(VLANClientState *nc, bool enable)
tap_write_poll(s, enable);
}
+int tap_get_fd(VLANClientState *nc)
+{
+ TAPState *s = DO_UPCAST(TAPState, nc, nc);
+ assert(nc->info->type == NET_CLIENT_TYPE_TAP);
+ return s->fd;
+}
+
/* fd support */
static NetClientInfo net_tap_info = {