diff mbox

[ovs-dev,CudaMailTagged,2/2] ovs-ctl: add environment controlled ovs-vswitchd arguments

Message ID 1453735395-3046-3-git-send-email-christian.ehrhardt@canonical.com
State Deferred
Headers show

Commit Message

Christian Ehrhardt Jan. 25, 2016, 3:23 p.m. UTC
ovs-vswitchd has arguments that are currently not exposed by
ovs-ctl as the project provided wrapper to start/stop the daemons.
This patch adds $OVS_VSWITCHD_OPTS which - if set - will be inserted in the
call to ovs-vswitchd as argument(s).
This avoids adding custom vars for each parameter that is there and
might be added.

Co-authored-by: James Page <james.page@canonical.com>
Signed-off-by: James Page <james.page@canonical.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
 debian/openvswitch-switch.template | 4 ++++
 utilities/ovs-ctl.in               | 3 +++
 2 files changed, 7 insertions(+)
diff mbox

Patch

diff --git a/debian/openvswitch-switch.template b/debian/openvswitch-switch.template
index 27cf7b5..4a04ccd 100644
--- a/debian/openvswitch-switch.template
+++ b/debian/openvswitch-switch.template
@@ -10,3 +10,7 @@ 
 # DPDK options - see /usr/share/doc/openvswitch-common/INSTALL.DPDK.md.gz
 # these are passed to ovs-vswitchd obeying to the positional requirements
 # DPDK_OPTS='--dpdk -vhost_sock_dir /var/run/openvswitch-vhost -c 0x1 -n 4'
+
+# OVS_VSWITCHD_OPTS: Extra options to pass to ovs-vswitchd.
+# This is, for example, a suitable place to specify verbosity options
+# OVS_VSWITCHD_OPTS=
diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index 7b3a3bf..2b4fde1 100755
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -224,6 +224,9 @@  start_forwarding () {
 	    if test X"$MLOCKALL" != Xno; then
 	        set "$@" --mlockall
 	    fi
+	    if test X"$OVS_VSWITCHD_OPTS" != X; then
+	        set "$@" $OVS_VSWITCHD_OPTS
+	    fi
 	    start_daemon "$OVS_VSWITCHD_PRIORITY" "$OVS_VSWITCHD_WRAPPER" "$@"
     fi
 }