In case the OVS kernel module is not installed, OVS userspace can
still be used.  Currently its absence blocks OVS startup.

Allow it with a warning.  Attempting to create a "system" type
bridge will fail with "No such file or directory" errors in the
ovs-vswitchd log.

Signed-off-by: Reuven Plevinsky <[email protected]>
---
 utilities/ovs-kmod-ctl.8  | 15 ++++++++++-----
 utilities/ovs-kmod-ctl.in |  6 ++++++
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/utilities/ovs-kmod-ctl.8 b/utilities/ovs-kmod-ctl.8
index c36638e79f52..6e9e3eeb1a3d 100644
--- a/utilities/ovs-kmod-ctl.8
+++ b/utilities/ovs-kmod-ctl.8
@@ -43,9 +43,13 @@ Each of \fBovs\-kmod\-ctl\fR's commands is described 
separately below.
 .
 .PP
 The \fBinsert\fR command loads the Open vSwitch kernel modules, if
-needed.  If this fails, and the Linux bridge module is loaded but no
-bridges exist, it tries to unload the bridge module and tries loading
-the Open vSwitch kernel module again.
+needed.  If the \fBopenvswitch\fR kernel module is not installed on
+the system, the command continues without it.
+.PP
+If \fBmodprobe\fR\|(8) fails for an installed module, and the Linux
+bridge module is loaded but no bridges exist, the command tries to
+unload the bridge module and retries loading the Open vSwitch kernel
+module.
 .
 .SH "The ``remove'' command"
 .
@@ -58,8 +62,9 @@ modules.
 .
 \fBovs\-kmod\-ctl\fR exits with status 0 on success and nonzero on
 failure.  The \fBinsert\fR command is considered to succeed if kernel
-modules are already loaded; the \fBremove\fR command is considered to
-succeed if none of the kernel modules are loaded.
+modules are already loaded or if the \fBopenvswitch\fR module is not
+installed; the \fBremove\fR command is considered to succeed if none of
+the kernel modules are loaded.
 .
 .SH "ENVIRONMENT"
 .
diff --git a/utilities/ovs-kmod-ctl.in b/utilities/ovs-kmod-ctl.in
index 19f1009647e2..f6d89aaf4e63 100644
--- a/utilities/ovs-kmod-ctl.in
+++ b/utilities/ovs-kmod-ctl.in
@@ -43,6 +43,12 @@ insert_kmods_if_required() {
     # If openvswitch is already loaded then we're done.
     test -e /sys/module/openvswitch && return 0
 
+    # If openvswitch module is not available then we're done.
+    if ! modinfo openvswitch > /dev/null 2>&1; then
+        log_warning_msg "openvswitch module isn't available"
+        return 0
+    fi
+
     # Load openvswitch.  If that's successful then we're done.
     insert_mods && return 0
 
-- 
2.43.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to