[PATCHv4 5/6] qemu/raw: add API to get raw socket

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add API to get raw socket from vlanclient,
so that we can connect it to frontend such as vhost.

Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
---
 net.c |    8 ++++++++
 net.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/net.c b/net.c
index 1fb2f2f..9168460 100644
--- a/net.c
+++ b/net.c
@@ -2025,6 +2025,14 @@ static int net_raw_init(Monitor *mon, VLANState *vlan, const char *model,
 	return 0;
 }
 
+int raw_get_fd(VLANClientState *vc)
+{
+	RAWState *s = vc->opaque;
+	if (vc->receive != raw_receive)
+		return -1;
+	return s->fd;
+}
+
 #if defined(CONFIG_VDE)
 typedef struct VDEState {
     VLANClientState *vc;
diff --git a/net.h b/net.h
index 00485e2..932b50d 100644
--- a/net.h
+++ b/net.h
@@ -94,6 +94,8 @@ int tap_get_fd(VLANClientState *vc);
 int tap_has_vnet_hdr(void *opaque);
 void tap_using_vnet_hdr(void *opaque, int using_vnet_hdr);
 
+int raw_get_fd(VLANClientState *vc);
+
 /* NIC info */
 
 #define MAX_NICS 8
-- 
1.6.5.2.143.g8cc62

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux