]> git.proxmox.com Git - ovs.git/commitdiff
ovs-save: Handle cases of upgrades from very old OVS versions.
authorGurucharan Shetty <guru@ovn.org>
Wed, 8 May 2019 13:55:27 +0000 (06:55 -0700)
committerGurucharan Shetty <guru@ovn.org>
Thu, 9 May 2019 10:58:32 +0000 (03:58 -0700)
We have added code to ovs-save over the last few releases
which makes the following bad assumptions.

1. The default OpenFlow version of running daemon is OpenFlow14.

Impact: This causes upgrades from older OVS versions to end up with no
flows in their bridges (even the default 'NORMAL' ones) causing traffic
to stop.

2. That ovs-ofctl commands like dump-groups and dump-tlv-map
will just work with old OVS versions.

Impact: Does not look like it effects the upgrade in a bad away - except
you get some errors.

Since OpenFlow14 was enabled by default in OVS 2.8, this commit makes
a lazy assumption that any upgrade of OVS from versions before 2.7
will not attempt to save and restore flows.

VMware-BZ: #2340482
Signed-off-by: Gurucharan Shetty <guru@ovn.org>
Acked-by: Ben Pfaff <blp@ovn.org>
utilities/ovs-save

index 1ba36e9deddc1ebd68d74cf8765b8e7669a9568f..7d810cb40efe2e841009392a04b44628856dc94d 100755 (executable)
@@ -110,6 +110,17 @@ save_flows () {
         exit 1
     fi
 
+    # OVS 2.7 and earlier do not enable OpenFlow 1.4 (by default) and lack
+    # other features needed to save and restore flows.  Don't try.
+    case `ovs-appctl version | sed 1q` in
+        "ovs-vswitchd (Open vSwitch) 1."*.*)
+            return
+            ;;
+        "ovs-vswitchd (Open vSwitch) 2."[0-7].*)
+            return
+            ;;
+    esac
+
     workdir=$(mktemp -d "${TMPDIR:-/tmp}/ovs-save.XXXXXXXXXX")
     for bridge in "$@"; do
         # Get the highest enabled OpenFlow version