From patchwork Mon Nov 2 22:24:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 57154 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA2MQkWx019280 for ; Mon, 2 Nov 2009 22:26:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757210AbZKBW0i (ORCPT ); Mon, 2 Nov 2009 17:26:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757196AbZKBW0i (ORCPT ); Mon, 2 Nov 2009 17:26:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14891 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756875AbZKBW0g (ORCPT ); Mon, 2 Nov 2009 17:26:36 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nA2MQaew032360; Mon, 2 Nov 2009 17:26:36 -0500 Received: from redhat.com (vpn-6-135.tlv.redhat.com [10.35.6.135]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id nA2MQWpZ026429; Mon, 2 Nov 2009 17:26:33 -0500 Date: Tue, 3 Nov 2009 00:24:09 +0200 From: "Michael S. Tsirkin" 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 Message-ID: <20091102222409.GF15153@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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