Populate the interface table's 'ofport_request' column with the value in the column 'ofport' while saving flows.
When vswitchd restarts, it will use the ofport_request value to set the value of ofport. Signed-off-by: Gurucharan Shetty <gshe...@nicira.com> --- utilities/ovs-save | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/utilities/ovs-save b/utilities/ovs-save index 2ab9d08..e8e8329 100755 --- a/utilities/ovs-save +++ b/utilities/ovs-save @@ -25,7 +25,9 @@ Commands: the current kernel configuration of the specified network interfaces, as well as the system iptables configuration. - save-flows Outputs a shell script on stdout that will restore + save-flows Populates the interface table's 'ofport_request' column + with the value in the column 'ofport' and then + outputs a shell script on stdout that will restore Openflow flows of each Open vSwitch bridge. This script is meant as a helper for the Open vSwitch init script commands. EOF @@ -160,13 +162,28 @@ save_interfaces () { fi } +ovs_vsctl () { + ovs-vsctl --no-wait --timeout=5 "$@" +} + save_flows () { if missing_program ovs-ofctl; then echo "$0: ovs-ofctl not found in $PATH" >&2 exit 1 fi + if missing_program ovs-vsctl; then + echo "$0: ovs-vsctl not found in $PATH" >&2 + exit 1 + fi + for bridge in "$@"; do + for iface in `ovs_vsctl list-ifaces ${bridge}`; do + ofport=`ovs_vsctl get interface ${iface} ofport` + ovs_vsctl set interface "${iface}" \ + ofport_request="${ofport}" 2>/dev/null + done + echo "ovs-ofctl add-flows ${bridge} - << EOF" ovs-ofctl dump-flows "${bridge}" | sed -e '/NXST_FLOW/d' \ -e 's/\(idle\|hard\)_age=[^,]*,//g' -- 1.7.9.5 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev