diff -r 1e3e30670ce4 tools/ioemu/target-i386-dm/qemu-ifup --- a/tools/ioemu/target-i386-dm/qemu-ifup Thu Dec 27 10:41:43 2007 +0000 +++ b/tools/ioemu/target-i386-dm/qemu-ifup Thu Dec 27 13:13:39 2007 +0000 @@ -5,8 +5,12 @@ echo 'config qemu network with xen bridge for ' $* +ifconfig $1 0.0.0.0 up + bridge=$2 +if [ -n "$bridge" ] +then # # Old style bridge setup with netloop, used to have a bridge name # of xenbrX, enslaving pethX and vif0.X, and then configuring @@ -25,13 +29,13 @@ bridge=$2 # # This lets old config files work without modification # -if [ ! -e "/sys/class/net/$bridge" ] && [ -z "${bridge##xenbr*}" ] -then - if [ -e "/sys/class/net/eth${bridge#xenbr}/bridge" ] + if [ ! -e "/sys/class/net/$bridge" ] && [ -z "${bridge##xenbr*}" ] then - bridge="eth${bridge#xenbr}" + if [ -e "/sys/class/net/eth${bridge#xenbr}/bridge" ] + then + bridge="eth${bridge#xenbr}" + fi fi + + brctl addif $bridge $1 fi - -ifconfig $1 0.0.0.0 up -brctl addif $bridge $1 diff -r 1e3e30670ce4 tools/ioemu/vl.c --- a/tools/ioemu/vl.c Thu Dec 27 10:41:43 2007 +0000 +++ b/tools/ioemu/vl.c Thu Dec 27 13:13:39 2007 +0000 @@ -100,11 +100,6 @@ #include "exec-all.h" #define DEFAULT_NETWORK_SCRIPT "/etc/xen/qemu-ifup" -#ifdef _BSD -#define DEFAULT_BRIDGE "bridge0" -#else -#define DEFAULT_BRIDGE "xenbr0" -#endif #ifdef __sun__ #define SMBD_COMMAND "/usr/sfw/sbin/smbd" #else @@ -4111,7 +4106,7 @@ static int net_client_init(const char *s if (!strcmp(device, "tap")) { char ifname[64]; char setup_script[1024]; - char bridge[16]; + char bridge[16], *_bridge = NULL; int fd; memset(ifname, 0, sizeof(ifname)); @@ -4129,10 +4124,10 @@ static int net_client_init(const char *s if (get_param_value(setup_script, sizeof(setup_script), "script", p) == 0) { pstrcpy(setup_script, sizeof(setup_script), DEFAULT_NETWORK_SCRIPT); } - if (get_param_value(bridge, sizeof(bridge), "bridge", p) == 0) { - pstrcpy(bridge, sizeof(bridge), DEFAULT_BRIDGE); - } - ret = net_tap_init(vlan, ifname, setup_script, bridge); + if (get_param_value(bridge, sizeof(bridge), "bridge", p) > 0) { + _bridge = bridge; + } + ret = net_tap_init(vlan, ifname, setup_script, _bridge); } } else #endif diff -r 1e3e30670ce4 tools/python/xen/xend/image.py --- a/tools/python/xen/xend/image.py Thu Dec 27 10:41:43 2007 +0000 +++ b/tools/python/xen/xend/image.py Thu Dec 27 13:13:39 2007 +0000 @@ -485,13 +485,17 @@ class HVMImageHandler(ImageHandler): mac = devinfo.get('mac') if mac is None: raise VmError("MAC address not specified or generated.") - bridge = devinfo.get('bridge', 'xenbr0') + bridge = devinfo.get('bridge') model = devinfo.get('model', 'rtl8139') ret.append("-net") ret.append("nic,vlan=%d,macaddr=%s,model=%s" % (nics, mac, model)) ret.append("-net") - ret.append("tap,vlan=%d,bridge=%s" % (nics, bridge)) + if bridge is None: + bridge = "" + else: + bridge = (",bridge=%s" % (bridge)) + ret.append("tap,vlan=%d%s" % (nics, bridge)) return ret diff -r 1e3e30670ce4 tools/xm-test/lib/XmTestLib/XenDevice.py --- a/tools/xm-test/lib/XmTestLib/XenDevice.py Thu Dec 27 10:41:43 2007 +0000 +++ b/tools/xm-test/lib/XmTestLib/XenDevice.py Thu Dec 27 13:13:39 2007 +0000 @@ -179,8 +179,6 @@ class XenNetDevice(XenDevice): if domain.getDomainType() == "HVM": self.config["type"] = "ioemu" - if not self.config.has_key('bridge'): - self.config["bridge"] = "xenbr0" if self.config.has_key("ip"): self.setNetDevIP(ip=self.config["ip"])