diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2010-03-17 13:07:50 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-04-01 13:56:43 -0500 |
commit | 95d528a2fe9f1eaec11dc3256dc9dec49b557990 (patch) | |
tree | 11c937b0f1f5e7810b82b8c00b626393be862f0c /net | |
parent | 087431d1d1bf4e785edfa89e8cd05fcdac558dc3 (diff) | |
download | qemu-95d528a2fe9f1eaec11dc3256dc9dec49b557990.zip qemu-95d528a2fe9f1eaec11dc3256dc9dec49b557990.tar.gz qemu-95d528a2fe9f1eaec11dc3256dc9dec49b557990.tar.bz2 |
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')
-rw-r--r-- | net/tap.c | 7 | ||||
-rw-r--r-- | net/tap.h | 2 |
2 files changed, 9 insertions, 0 deletions
@@ -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 = { @@ -48,4 +48,6 @@ int tap_probe_vnet_hdr(int fd); int tap_probe_has_ufo(int fd); void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo); +int tap_get_fd(VLANClientState *vc); + #endif /* QEMU_NET_TAP_H */ |