IP="/sbin/ip"
vsctl="/usr/bin/ovs-vsctl"
-dump_vif_details="/usr/share/vswitch/scripts/dump-vif-details"
handle_promiscuous()
{
local net_uuid=$(xenstore-read "${PRIVATE}/network-uuid" 2>/dev/null)
if [ -n "${net_uuid}" ] ; then
logger -t scripts-vif "${bridge} xs-network-uuids ${net_uuid}"
- echo "-- br-set-external-id \"$bridge\" xs-network-uuids \"${net_uuid}\""
+ echo "-- br-set-external-id $bridge xs-network-uuids ${net_uuid}"
fi
else
# XAPI after 5.5.0 sets the network external ids itself, via ovs-vsctl.
local vif_details=$(handle_vswitch_vif_details)
fi
- $vsctl -- --if-exists del-port $dev -- add-port $bridge $dev $vif_details $(xs550_set_internal_network_uuid)
+ $vsctl -- --if-exists del-port $dev -- add-port $bridge $dev $vif_details $(xs550_set_internal_network_uuid $bridge)
;;
esac
# Nothing to do
;;
vswitch)
- $vsctl del-port $bridge $dev
+ # If ovs-brcompatd is running, it might already have deleted the
+ # port. Use --if-exists to suppress the error that would otherwise
+ # arise in that case.
+ $vsctl -- --if-exists del-port $dev
;;
esac
}