ovs-ctl: Remove vport_* modules when downgrade from branches > 2.3.
authorAlex Wang <alexw@nicira.com>
Tue, 26 May 2015 23:18:50 +0000 (16:18 -0700)
committerAlex Wang <alexw@nicira.com>
Wed, 27 May 2015 01:00:00 +0000 (18:00 -0700)
When downgrading from current master to branch-2.3, the 'force-reload-kmod'
can fail due to not removing 'vport_*' modules, this commit fixes this by
making sure 'vport_*' are removed correctly.

Reported-by: Mark Hamilton <mhamilton@vmware.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
utilities/ovs-ctl.in

index f765553..46a6fb1 100755 (executable)
@@ -378,6 +378,11 @@ force_reload_kmod () {
         action "Removing datapath: $dp" ovs-dpctl del-dp "$dp"
     done
 
+    # For downgrading from branches > 2.3 back to 2.3
+    for vport in `awk '/^vport_/ { print $1 }' /proc/modules`; do
+        action "Removing $vport module" rmmod $vport
+    done
+
     # try both old and new names in case this is post upgrade
     if test -e /sys/module/openvswitch_mod; then
         action "Removing openvswitch module" rmmod openvswitch_mod