summaryrefslogtreecommitdiff
path: root/utilities
diff options
context:
space:
mode:
authorSimon Horman <simon.horman@netronome.com>2015-08-20 16:45:34 -0700
committerGurucharan Shetty <gshetty@nicira.com>2015-08-21 11:03:02 -0700
commit24605d4e58ff5d74845d9ae9339f723c0f13608f (patch)
tree023100e9cd714249c9fd6d50f4ac16fcf0d88e8e /utilities
parent6ca49d5ec1e29b0b12a47fe5ceee036074edc33d (diff)
downloadopenvswitch-24605d4e58ff5d74845d9ae9339f723c0f13608f.tar.gz
ovs-ctl: do not attempt to restore flows when called with --delete-bridges
When called with --delete-bridges saved flows cannot be restored as the bridges to which they belong no longer exist. This results in the following error messages on restart. ovs-ofctl: br0 is not a bridge or a socket Restoring saved flows ... failed! Although there is no effect of this error other than the message it seems worth avoiding. This patch does so by skipping saving of flows when --delete-bridges is in effect. As flows are no longer saved when --delete-bridges is in effect a side-effect of this change is that restart may be faster when there are many flows. Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'utilities')
-rwxr-xr-xutilities/ovs-ctl.in12
1 files changed, 8 insertions, 4 deletions
diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index 99d789c68..918be2c9c 100755
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -322,6 +322,12 @@ save_ofports_if_required () {
esac
}
+save_flows_if_required () {
+ if test X"$DELETE_BRIDGES" != Xyes; then
+ action "Saving flows" ovs_save save-flows "${script_flows}"
+ fi
+}
+
save_interfaces () {
"$datadir/scripts/ovs-save" save-interfaces ${ifaces} \
> "${script_interfaces}"
@@ -372,9 +378,7 @@ force_reload_kmod () {
action "Detected internal interfaces: $ifaces" true
init_restore_scripts
-
- action "Saving flows" ovs_save save-flows "${script_flows}"
-
+ save_flows_if_required
save_ofports_if_required
# Restart the database first, since a large database may take a
@@ -450,7 +454,7 @@ restart () {
if daemon_is_running ovsdb-server && daemon_is_running ovs-vswitchd; then
init_restore_scripts
save_interfaces_if_required
- action "Saving flows" ovs_save save-flows "${script_flows}"
+ save_flows_if_required
save_ofports_if_required
fi