public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: avi@redhat.com, kvm@vger.kernel.org,
	virtualization@lists.linux-foundation.org
Cc: gregory.haskins@gmail.com
Subject: [PATCHv4 5/6] qemu/raw: add API to get raw socket
Date: Tue, 3 Nov 2009 00:24:09 +0200	[thread overview]
Message-ID: <20091102222409.GF15153@redhat.com> (raw)
In-Reply-To: <cover.1257200517.git.mst@redhat.com>

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@redhat.com>
---
 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


  parent reply	other threads:[~2009-11-02 22:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1257200517.git.mst@redhat.com>
2009-11-02 22:23 ` [PATCHv4 1/6] qemu/virtio: move features to an inline function Michael S. Tsirkin
2009-11-02 22:33   ` Anthony Liguori
2009-11-03  5:08     ` Avi Kivity
2009-11-03 10:40     ` Michael S. Tsirkin
2009-11-02 22:23 ` [PATCHv4 2/6] qemu/net: routines to get tap fd Michael S. Tsirkin
2009-11-02 22:23 ` [PATCHv4 3/6] qemu/net: add raw backend Or Gerlitz
2009-11-02 22:24 ` [PATCHv4 4/6] qemu/net: move typedef to qemu-common.h Michael S. Tsirkin
2009-11-02 22:24 ` Michael S. Tsirkin [this message]
2009-11-02 22:24 ` [PATCHv4 6/6] qemu-kvm: vhost-net implementation Michael S. Tsirkin
2009-11-05  0:22   ` Sridhar Samudrala
2009-11-05  8:23     ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091102222409.GF15153@redhat.com \
    --to=mst@redhat.com \
    --cc=avi@redhat.com \
    --cc=gregory.haskins@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox