From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ru4kE-0007ev-K5 for qemu-devel@nongnu.org; Sun, 05 Feb 2012 11:15:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ru4kD-0000aq-HW for qemu-devel@nongnu.org; Sun, 05 Feb 2012 11:15:14 -0500 Received: from e39.co.us.ibm.com ([32.97.110.160]:36505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ru4kD-0000Uo-AK for qemu-devel@nongnu.org; Sun, 05 Feb 2012 11:15:13 -0500 Received: from /spool/local by e39.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 5 Feb 2012 09:14:59 -0700 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [9.17.195.228]) by d03dlp02.boulder.ibm.com (Postfix) with ESMTP id 3DB293E40047 for ; Sun, 5 Feb 2012 09:14:43 -0700 (MST) Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [9.17.195.170]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q15GEhMQ165354 for ; Sun, 5 Feb 2012 09:14:43 -0700 Received: from d03av04.boulder.ibm.com (loopback [127.0.0.1]) by d03av04.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q15GEguc028238 for ; Sun, 5 Feb 2012 09:14:42 -0700 Message-ID: <4F2EAAF0.8070700@linux.vnet.ibm.com> Date: Sun, 05 Feb 2012 11:14:40 -0500 From: Corey Bryant MIME-Version: 1.0 References: <1328343886-28127-1-git-send-email-sw@weilnetz.de> In-Reply-To: <1328343886-28127-1-git-send-email-sw@weilnetz.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] w32: Fix build with new net bridge code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Weil Cc: Anthony Liguori , qemu-devel@nongnu.org On 02/04/2012 03:24 AM, Stefan Weil wrote: > Commit a7c36ee4920ea3acc227a0248dd161693f207357 added code for a net > bridge and explicitly said that "this is very Linux centric". > > Indeed, compilation failed for w32, so the bridge code is now > conditional. Hosts which don't support it can simply remove the > definition of CONFIG_NET_BRIDGE. > > Signed-off-by: Stefan Weil > --- > > Was the .name = "helper" intentional? That name is rather unspecific. > > Regards, > Stefan Weil > Thanks a lot for the patch. The "helper" option takes a command to execute a helper program that adds a tap device to a network bridge. So I'm thinking "bridgehelper" would be more descriptive, though a bit long. -- Regards, Corey > net.c | 19 ++++++++++++++++--- > 1 files changed, 16 insertions(+), 3 deletions(-) > > diff --git a/net.c b/net.c > index 1944539..c34474f 100644 > --- a/net.c > +++ b/net.c > @@ -38,6 +38,11 @@ > #include "hw/qdev.h" > #include "iov.h" > > +/* Net bridge is currently not supported for W32. */ > +#if !defined(_WIN32) > +# define CONFIG_NET_BRIDGE > +#endif > + > static QTAILQ_HEAD(, VLANState) vlans; > static QTAILQ_HEAD(, VLANClientState) non_vlan_clients; > > @@ -952,10 +957,12 @@ static const struct { > .type = QEMU_OPT_STRING, > .help = "script to shut down the interface", > }, { > +#ifdef CONFIG_NET_BRIDGE > .name = "helper", > .type = QEMU_OPT_STRING, > .help = "command to execute to configure bridge", > }, { > +#endif > .name = "sndbuf", > .type = QEMU_OPT_SIZE, > .help = "send buffer limit" > @@ -1057,6 +1064,7 @@ static const struct { > { /* end of list */ } > }, > }, > +#ifdef CONFIG_NET_BRIDGE > [NET_CLIENT_TYPE_BRIDGE] = { > .type = "bridge", > .init = net_init_bridge, > @@ -1074,6 +1082,7 @@ static const struct { > { /* end of list */ } > }, > }, > +#endif /* CONFIG_NET_BRIDGE */ > }; > > int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev) > @@ -1090,14 +1099,16 @@ int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev) > > if (is_netdev) { > if (strcmp(type, "tap") != 0&& > +#ifdef CONFIG_NET_BRIDGE > + strcmp(type, "bridge") != 0&& > +#endif > #ifdef CONFIG_SLIRP > strcmp(type, "user") != 0&& > #endif > #ifdef CONFIG_VDE > strcmp(type, "vde") != 0&& > #endif > - strcmp(type, "socket") != 0&& > - strcmp(type, "bridge") != 0) { > + strcmp(type, "socket") != 0) { > qerror_report(QERR_INVALID_PARAMETER_VALUE, "type", > "a netdev backend type"); > return -1; > @@ -1161,13 +1172,15 @@ static int net_host_check_device(const char *device) > { > int i; > const char *valid_param_list[] = { "tap", "socket", "dump" > +#ifdef CONFIG_NET_BRIDGE > + , "bridge" > +#endif > #ifdef CONFIG_SLIRP > ,"user" > #endif > #ifdef CONFIG_VDE > ,"vde" > #endif > - , "bridge" > }; > for (i = 0; i< sizeof(valid_param_list) / sizeof(char *); i++) { > if (!strncmp(valid_param_list[i], device,