[ovs-dev] [PATCH] ovs-ctl: Add support for built-in (non-modular) kernel support.

Ben Pfaff blp at nicira.com
Tue Feb 5 19:14:34 UTC 2013


Reported-by: Cong Wang <xiyou.wangcong at gmail.com>
Signed-off-by: Ben Pfaff <blp at nicira.com>
---
Cong, will you verify that this makes the init script work OK for
your kernel with OVS built-in?

Thanks,

Ben.

 utilities/ovs-ctl.in |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index 8288e13..63dbbca 100755
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -35,6 +35,12 @@ insert_openvswitch_mod_if_required () {
     test -e /sys/module/openvswitch -o -e /sys/module/openvswitch_mod && \
      return 0
 
+    # If "ovs-dpctl show" succeeds, even though the kernel module doesn't
+    # appear to be loaded, then Open vSwitch support is built into the
+    # kernel instead of modular (or the kernel module is loaded but sysfs
+    # is not mounted).
+    ovs-dpctl show -voff >/dev/null 2>&1 && return 0
+
     # Load openvswitch.  If that's successful then we're done.
     action "Inserting openvswitch module" modprobe openvswitch && return 0
 
-- 
1.7.2.5




More information about the dev mailing list