提交 95d528a2 编写于 作者: M Michael S. Tsirkin 提交者: Anthony Liguori

tap: add interface to get device fd

Will be used by vhost to attach/detach to backend.
Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 087431d1
......@@ -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 */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册