Index: xen-3.3.0-testing/tools/examples/xend-config.sxp =================================================================== --- xen-3.3.0-testing.orig/tools/examples/xend-config.sxp +++ xen-3.3.0-testing/tools/examples/xend-config.sxp @@ -141,7 +141,8 @@ # # (network-script 'network-bridge netdev=eth1') # -# The bridge is named xenbr0, by default. To rename the bridge, use +# The bridge is named to match the outgoing interface, by default. For example, +# eth1 is on xenbr1. To rename the bridge, use # # (network-script 'network-bridge bridge=') # Index: xen-3.3.0-testing/tools/ioemu-remote/vl.c =================================================================== --- xen-3.3.0-testing.orig/tools/ioemu-remote/vl.c +++ xen-3.3.0-testing/tools/ioemu-remote/vl.c @@ -134,8 +134,8 @@ int inet_aton(const char *cp, struct in_ #include "exec-all.h" #ifndef DEFAULT_NETWORK_SCRIPT -#define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" -#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" +#define DEFAULT_NETWORK_SCRIPT "/etc/xen/qemu-ifup" +#define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/xen/qemu-ifdown" #endif #ifdef __sun__ #define SMBD_COMMAND "/usr/sfw/sbin/smbd" @@ -4997,10 +4997,10 @@ static int net_client_init(const char *s pstrcpy(down_script, sizeof(down_script), DEFAULT_NETWORK_DOWN_SCRIPT); } if (get_param_value(script_arg, sizeof(script_arg), "scriptarg", p) == 0 && - get_param_value(script_arg, sizeof(script_arg), "bridge", p) == 0) { /* deprecated; for xend compatibility */ - pstrcpy(script_arg, sizeof(script_arg), ""); - } - ret = net_tap_init(vlan, ifname, setup_script, down_script, script_arg); + get_param_value(script_arg, sizeof(script_arg), "bridge", p) == 0) /* deprecated; for xend compatibility */ + ret = net_tap_init(vlan, ifname, setup_script, NULL, NULL); + else + ret = net_tap_init(vlan, ifname, setup_script, down_script, script_arg); } } else #endif Index: xen-3.3.0-testing/tools/python/xen/xend/image.py =================================================================== --- xen-3.3.0-testing.orig/tools/python/xen/xend/image.py +++ xen-3.3.0-testing/tools/python/xen/xend/image.py @@ -764,14 +764,16 @@ 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', None) 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,ifname=tap%d.%d,bridge=%s" % - (nics, self.vm.getDomid(), nics-1, bridge)) + net = "tap,vlan=%d,ifname=tap%d.%d" % (nics, self.vm.getDomid(), nics-1) + if bridge: + net += ",bridge=%s" % bridge + ret.append(net) if nics == 0: ret.append("-net") Index: xen-3.3.0-testing/tools/ioemu-remote/i386-dm/qemu-ifup =================================================================== --- xen-3.3.0-testing.orig/tools/ioemu-remote/i386-dm/qemu-ifup +++ xen-3.3.0-testing/tools/ioemu-remote/i386-dm/qemu-ifup @@ -1,11 +1,11 @@ #!/bin/sh -#. /etc/rc.d/init.d/functions -#ulimit -c unlimited - -echo 'config qemu network with xen bridge for ' $* - bridge=$2 +if [ -z "$bridge" ]; then + brnum=$(ip route list | awk '/^default / { print $NF }' | sed 's/^[^0-9]*//') + brnum=${brnum:-0} + bridge=xenbr${brnum} +fi # # Old style bridge setup with netloop, used to have a bridge name