render / rpms / qemu

Forked from rpms/qemu 9 months ago
Clone

Blame qemu-tap-add-API-to-retrieve-vhost-net-header.patch

Justin M. Forbes 272dfe
will be used by virtio-net for vhost net support
Justin M. Forbes 272dfe
Justin M. Forbes 272dfe
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Justin M. Forbes 272dfe
---
Justin M. Forbes 272dfe
 net/tap.c |    7 +++++++
Justin M. Forbes 272dfe
 net/tap.h |    3 +++
Justin M. Forbes 272dfe
 2 files changed, 10 insertions(+), 0 deletions(-)
Justin M. Forbes 272dfe
Justin M. Forbes 272dfe
diff --git a/net/tap.c b/net/tap.c
Justin M. Forbes 272dfe
index d9f2e41..166cf05 100644
Justin M. Forbes 272dfe
--- a/net/tap.c
Justin M. Forbes 272dfe
+++ b/net/tap.c
Justin M. Forbes 272dfe
@@ -491,3 +491,10 @@ int net_init_tap(QemuOpts *opts, Monitor *mon, const char *name, VLANState *vlan
Justin M. Forbes 272dfe
 
Justin M. Forbes 272dfe
     return 0;
Justin M. Forbes 272dfe
 }
Justin M. Forbes 272dfe
+
Justin M. Forbes 272dfe
+struct vhost_net *tap_get_vhost_net(VLANClientState *nc)
Justin M. Forbes 272dfe
+{
Justin M. Forbes 272dfe
+    TAPState *s = DO_UPCAST(TAPState, nc, nc);
Justin M. Forbes 272dfe
+    assert(nc->info->type == NET_CLIENT_TYPE_TAP);
Justin M. Forbes 272dfe
+    return s->vhost_net;
Justin M. Forbes 272dfe
+}
Justin M. Forbes 272dfe
diff --git a/net/tap.h b/net/tap.h
Justin M. Forbes 272dfe
index a244b28..b8cec83 100644
Justin M. Forbes 272dfe
--- a/net/tap.h
Justin M. Forbes 272dfe
+++ b/net/tap.h
Justin M. Forbes 272dfe
@@ -50,4 +50,7 @@ void tap_fd_set_offload(int fd, int csum, int tso4, int tso6, int ecn, int ufo);
Justin M. Forbes 272dfe
 
Justin M. Forbes 272dfe
 int tap_get_fd(VLANClientState *vc);
Justin M. Forbes 272dfe
 
Justin M. Forbes 272dfe
+struct vhost_net;
Justin M. Forbes 272dfe
+struct vhost_net *tap_get_vhost_net(VLANClientState *vc);
Justin M. Forbes 272dfe
+
Justin M. Forbes 272dfe
 #endif /* QEMU_NET_TAP_H */
Justin M. Forbes 272dfe
-- 
Justin M. Forbes 272dfe
1.6.6.144.g5c3af