X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=xenserver%2Fetc_xensource_scripts_vif;h=2fcf9d402b65a4ab2feaa62442b32a3e83cd3ed5;hb=e423eca6e9bb71cb6e61fa3aeaa70e5525507770;hp=fb7517ad550a02817db2f5ad7a4e03a53d8b9542;hpb=42ab0203399b1ea32556319e1c73aa093c4b24f9;p=openvswitch diff --git a/xenserver/etc_xensource_scripts_vif b/xenserver/etc_xensource_scripts_vif index fb7517ad..2fcf9d40 100755 --- a/xenserver/etc_xensource_scripts_vif +++ b/xenserver/etc_xensource_scripts_vif @@ -11,8 +11,9 @@ # Keep other-config/ keys in sync with device.ml:vif_udev_keys -cfg_mod="/root/vswitch/bin/ovs-cfg-mod" -dump_vif_details="/root/vswitch/scripts/dump-vif-details" +cfg_mod="/usr/bin/ovs-cfg-mod" +vsctl="/usr/bin/ovs-vsctl" +dump_vif_details="/usr/share/vswitch/scripts/dump-vif-details" service="/sbin/service" TYPE=`echo ${XENBUS_PATH} | cut -f 2 -d '/'` @@ -31,8 +32,8 @@ handle_promiscuous() local arg=$(xenstore-read "${PRIVATE}/other-config/promiscuous") if [ $? -eq 0 -a -n "${arg}" ] ; then case "${arg}" in - true|on) echo 1 > /sys/class/net/${vif}/brport/promisc ;; - *) echo 0 > /sys/class/net/${vif}/brport/promisc ;; + true|on) logger -t script-vif "${vif}: Promiscuous ports are not supported via vSwitch." ;; + *) ;; esac fi } @@ -70,13 +71,11 @@ add_to_bridge() fi logger -t scripts-vif "Adding ${vif} to ${bridge} with address ${address}" - vid= - if [ -e "/etc/openvswitch/br-$bridge" ]; then - . "/etc/openvswitch/br-$bridge" - if [ -n "$VLAN_SLAVE" -a -n "$VLAN_VID" ]; then - bridge=$VLAN_SLAVE - vid="--add=vlan.$vif.tag=$VLAN_VID" - fi + local VLAN_ID=$($vsctl br-to-vlan $bridge) + local vid= + if [ "$VLAN_ID" -ne 0 ] ; then + bridge=$($vsctl br-to-parent $bridge) + vid="--add=vlan.${vif}.tag=${VLAN_ID}" fi ${IP} link set "${vif}" down || logger -t scripts-vif "Failed to ip link set ${vif} down"