From 131f10cdcf17dc6155aed240618a5f286d6ca06f Mon Sep 17 00:00:00 2001 From: "Michael S. Tsirkin" Date: Wed, 17 Mar 2010 13:07:50 +0200 Subject: tap: add interface to get device fd Will be used by vhost to attach/detach to backend. Signed-off-by: Michael S. Tsirkin Signed-off-by: Anthony Liguori --- net/tap.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'net/tap.c') 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 = { -- cgit v1.2.3