Comments
Patch
@@ -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;
@@ -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);
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(-)