Sorry, I mis-understood the 'used-by' field of 'lsmod' output.

The commit msg and comment is confusing, sending v2,

On Tue, Apr 21, 2015 at 7:00 PM, Alex Wang <al...@nicira.com> wrote:

> With the latest change of separating vports into their own modules,
> before removing the openvswitch kernel module, we must remove all
> modules used by it first.  Otherwise, the force-reload-kmod will
> fail due to:
>
> e.g., Module openvswitch is in use by vport_vxlan         [FAILED]
>
> Signed-off-by: Alex Wang <al...@nicira.com>
> ---
>  utilities/ovs-ctl.in |    5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
> index 6d2e938..650deb0 100755
> --- a/utilities/ovs-ctl.in
> +++ b/utilities/ovs-ctl.in
> @@ -392,6 +392,11 @@ force_reload_kmod () {
>      if test -e /sys/module/openvswitch_mod; then
>          action "Removing openvswitch module" rmmod openvswitch_mod
>      elif test -e /sys/module/openvswitch; then
> +        # extract all modules used by openvswitch and remove them first.
> +        depend_mods=$(lsmod | awk '$1 == "openvswitch" {print $4}' | tr
> ',' ' ')
> +        for __mod in ${depend_mods}; do
> +            action "Removing ${__mod} module" rmmod ${__mod}
> +        done
>          action "Removing openvswitch module" rmmod openvswitch
>      fi
>
> --
> 1.7.9.5
>
>
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to