From patchwork Tue Nov 22 18:18:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Finucane X-Patchwork-Id: 697858 X-Patchwork-Delegate: rbryant@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tNYhM3J7Rz9svs for ; Wed, 23 Nov 2016 05:21:39 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=that.guru header.i=@that.guru header.b="oog09nTX"; dkim-atps=neutral Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 13B25B30; Tue, 22 Nov 2016 18:19:38 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 7647FB4A for ; Tue, 22 Nov 2016 18:19:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from caracal.maple.relay.mailchannels.net (caracal.maple.relay.mailchannels.net [23.83.214.30]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id A0E561F5 for ; Tue, 22 Nov 2016 18:19:34 +0000 (UTC) X-Sender-Id: mxroute|x-authuser|stephen@that.guru Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 509481BC689 for ; Tue, 22 Nov 2016 18:19:31 +0000 (UTC) Received: from one.mxroute.com (ip-10-27-139-41.us-west-2.compute.internal [10.27.139.41]) by relay.mailchannels.net (Postfix) with ESMTPA id 994FC1BD093 for ; Tue, 22 Nov 2016 18:19:30 +0000 (UTC) X-Sender-Id: mxroute|x-authuser|stephen@that.guru Received: from one.mxroute.com ([TEMPUNAVAIL]. [10.20.148.190]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.7.8); Tue, 22 Nov 2016 18:19:31 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: mxroute|x-authuser|stephen@that.guru X-MailChannels-Auth-Id: mxroute X-MC-Loop-Signature: 1479838770994:1122666988 X-MC-Ingress-Time: 1479838770994 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=GVDwT79Nwb0PUPFHbasLaVkHOYf3ZSG+zmP+W90fHOc=; b=oog09nTX6AfPzzj5JDvsOzeBlm +SxOQ4Hpzs35MMgySJpGSCUoARmJBn8tzMZ2w7A7LKY75m0dck4N5EnWAdcLCiQ3+S87nnSW2AlGG PxZa7EskeP/kSdXlqF+ZZ+eStEDPFlCqmNymHXqxFys1mdPdlpwE+w8teT/Nm/Zi90kx2rAT/b8EG NIWQstkviVBKKgYGQ6ZBYVssDk2kjmOCcSmrTdmTfu9Ibtb2F8R8wX+wFZR9HANpqUkAtitw7/1NU 3Cp59rFjKPznuMgGRzmLJWFihxlaEXJKpJ+bzmKCj68DOr6D/TjOLmGbH9Y1dBDGmI+vq/j71qlLN 11WYXu3g==; From: Stephen Finucane To: dev@openvswitch.org Date: Tue, 22 Nov 2016 18:18:46 +0000 Message-Id: <1479838739-26356-2-git-send-email-stephen@that.guru> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1479838739-26356-1-git-send-email-stephen@that.guru> References: <1479838739-26356-1-git-send-email-stephen@that.guru> X-OutGoing-Spam-Status: No, score=-10.0 X-AuthUser: stephen@that.guru X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 01/14] trivial: Don't mix tabs and spaces in ovs-sim X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Signed-off-by: Stephen Finucane --- utilities/ovs-sim.in | 100 +++++++++++++++++++-------------------- xenserver/etc_init.d_openvswitch | 18 +++---- 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/utilities/ovs-sim.in b/utilities/ovs-sim.in index 7e43c96..3f31b25 100755 --- a/utilities/ovs-sim.in +++ b/utilities/ovs-sim.in @@ -44,10 +44,10 @@ EOF exit 1 ;; *) - case $option in - /*) ;; - *) option=`pwd`/$option ;; - esac + case $option in + /*) ;; + *) option=`pwd`/$option ;; + esac scripts="$scripts $option" ;; esac @@ -80,11 +80,11 @@ sim_base=`pwd`; export sim_base trap_signals() { for signal in 0 1 2 3 13 14 15; do - trap " - set +e - cd '$sim_base' && (kill \`cat */*.pid\`) >/dev/null 2>&1 - trap - $signal - kill -$signal $$" $signal + trap " + set +e + cd '$sim_base' && (kill \`cat */*.pid\`) >/dev/null 2>&1 + trap - $signal + kill -$signal $$" $signal done } export -f trap_signals @@ -102,15 +102,15 @@ export -f sim_setvars as() { case $# in - 0) + 0) echo >&2 "$FUNCNAME: missing arguments (use --help for help)" return 1 - ;; - 1) - if test "$1" != --help; then - sim_setvars $1 - else - cat <&2 "$FUNCNAME: missing argument (use --help for help)" @@ -153,8 +153,8 @@ EOF fi if test -e "$sim_base/$1"; then - echo >&2 "$1 already exists" - return 1 + echo >&2 "$1 already exists" + return 1 fi # Create sandbox. @@ -184,7 +184,7 @@ usage: $FUNCNAME NETWORK where NETWORK is the name of the new network. Interconnection networks are used with net_attach and ovn_attach. EOF - return 0 + return 0 fi if test $# != 1; then echo >&2 "$FUNCNAME: missing argument (use --help for help)" @@ -205,28 +205,28 @@ Adds a port to BRIDGE within the default sandbox that connects BRIDGE to the interconnection network NETWORK. (Use "as" to set the default sandbox.) EOF - return 0 + return 0 fi if test $# != 2; then echo >&2 "$FUNCNAME: wrong number of arguments (use --help for help)" return 1 fi if test $sandbox = main; then - echo >&2 "$FUNCNAME: can only attach interconnection networks to sandboxes other than main" - return 1 + echo >&2 "$FUNCNAME: can only attach interconnection networks to sandboxes other than main" + return 1 fi local net=$1 bridge=$2 port=${sandbox}_$bridge as main ovs-vsctl \ - -- add-port $net "$port" \ - -- set Interface "$port" options:pstream="punix:$sim_base/main/$port.sock" options:rxq_pcap="$sim_base/main/$port-rx.pcap" options:tx_pcap="$sim_base/main/$port-tx.pcap" options:header=extended + -- add-port $net "$port" \ + -- set Interface "$port" options:pstream="punix:$sim_base/main/$port.sock" options:rxq_pcap="$sim_base/main/$port-rx.pcap" options:tx_pcap="$sim_base/main/$port-tx.pcap" options:header=extended ovs-vsctl \ - -- set Interface $bridge options:tx_pcap="$sim_base/$sandbox/$bridge-tx.pcap" options:rxq_pcap="$sim_base/$sandbox/$bridge-rx.pcap" \ - -- add-port $bridge ${bridge}_$net \ - -- set Interface ${bridge}_$net options:stream="unix:$sim_base/main/$port.sock" options:rxq_pcap="$sim_base/$sandbox/${bridge}_$net-rx.pcap" options:tx_pcap="$sim_base/$sandbox/${bridge}_$net-tx.pcap" options:header=extended + -- set Interface $bridge options:tx_pcap="$sim_base/$sandbox/$bridge-tx.pcap" options:rxq_pcap="$sim_base/$sandbox/$bridge-rx.pcap" \ + -- add-port $bridge ${bridge}_$net \ + -- set Interface ${bridge}_$net options:stream="unix:$sim_base/main/$port.sock" options:rxq_pcap="$sim_base/$sandbox/${bridge}_$net-rx.pcap" options:tx_pcap="$sim_base/$sandbox/${bridge}_$net-tx.pcap" options:header=extended } export -f net_attach @@ -240,7 +240,7 @@ This creates and initializes the central OVN databases (northbound and southbound), starts their ovsdb-server daemons, and starts the ovn-northd daemon. EOF - return 0 + return 0 fi if test $# != 0; then echo >&2 "$FUNCNAME: no arguments accepted (use --help for help)" @@ -248,16 +248,16 @@ EOF fi if test -d ovn-sb || test -d ovn-nb; then - echo >&2 "OVN already started" - exit 1 + echo >&2 "OVN already started" + exit 1 fi daemon_opts="--detach --no-chdir --pidfile -vconsole:off --log-file" for db in ovn-sb ovn-nb; do - mkdir "$sim_base"/$db - touch "$sim_base"/$db/.$db.db.~lock~ - as $db ovsdb-tool create "$sim_base"/$db/$db.db "$sim_srcdir"/ovn/$db.ovsschema - as $db ovsdb-server $daemon_opts --remote=punix:"$sim_base"/$db/$db.sock "$sim_base"/$db/$db.db + mkdir "$sim_base"/$db + touch "$sim_base"/$db/.$db.db.~lock~ + as $db ovsdb-tool create "$sim_base"/$db/$db.db "$sim_srcdir"/ovn/$db.ovsschema + as $db ovsdb-server $daemon_opts --remote=punix:"$sim_base"/$db/$db.sock "$sim_base"/$db/$db.db done OVN_NB_DB=unix:$sim_base/ovn-nb/ovn-nb.sock; export OVN_NB_DB @@ -268,8 +268,8 @@ EOF mkdir "$sim_base"/northd as northd ovn-northd $daemon_opts \ - --ovnnb-db="$OVN_NB_DB" \ - --ovnsb-db="$OVN_SB_DB" + --ovnnb-db="$OVN_NB_DB" \ + --ovnsb-db="$OVN_SB_DB" } export -f ovn_start @@ -285,7 +285,7 @@ and configures ovn-controller. MASKLEN defaults to 24 if it is not specified. EOF - return 0 + return 0 fi if test $# != 3 && test $# != 4; then echo >&2 "$FUNCNAME: wrong number of arguments (use --help for help)" @@ -298,12 +298,12 @@ EOF ovs-appctl netdev-dummy/ip4addr $bridge $ip/$masklen >/dev/null ovs-appctl ovs/route/add $ip/$masklen $bridge > /dev/null ovs-vsctl \ - -- set Open_vSwitch . external-ids:system-id=$sandbox \ + -- set Open_vSwitch . external-ids:system-id=$sandbox \ -- set Open_vSwitch . external-ids:ovn-remote=unix:$sim_base/ovn-sb/ovn-sb.sock \ - -- set Open_vSwitch . external-ids:ovn-encap-type=geneve \ - -- set Open_vSwitch . external-ids:ovn-encap-ip=$ip\ - -- add-br br-int \ - -- set bridge br-int fail-mode=secure other-config:disable-in-band=true + -- set Open_vSwitch . external-ids:ovn-encap-type=geneve \ + -- set Open_vSwitch . external-ids:ovn-encap-ip=$ip\ + -- add-br br-int \ + -- set bridge br-int fail-mode=secure other-config:disable-in-band=true ovn-controller --detach --no-chdir --pidfile -vconsole:off --log-file } export -f ovn_attach @@ -318,10 +318,10 @@ export scripts export interactive rc=' if [ -f /etc/bashrc ]; then - . /etc/bashrc + . /etc/bashrc fi if [ -f ~/.bashrc ]; then - . ~/.bashrc + . ~/.bashrc fi trap_signals diff --git a/xenserver/etc_init.d_openvswitch b/xenserver/etc_init.d_openvswitch index 9c0fe80..7d2103f 100755 --- a/xenserver/etc_init.d_openvswitch +++ b/xenserver/etc_init.d_openvswitch @@ -45,9 +45,9 @@ esac start_ovs_xapi_sync () { if daemon_is_running ovs-xapi-sync; then - log_success_msg "ovs-xapi-sync is already running" + log_success_msg "ovs-xapi-sync is already running" else - PYTHONPATH=/usr/share/openvswitch/python \ + PYTHONPATH=/usr/share/openvswitch/python \ /usr/share/openvswitch/scripts/ovs-xapi-sync \ --log-file --pidfile --detach --monitor unix:/var/run/openvswitch/db.sock fi @@ -61,16 +61,16 @@ start () { set "$@" --external-id=xs-system-uuid="$INSTALLATION_UUID" set "$@" --daemon-cwd=/var/xen/openvswitch if test X"$FORCE_COREFILES" != X; then - set "$@" --force-corefiles="$FORCE_COREFILES" + set "$@" --force-corefiles="$FORCE_COREFILES" fi if test X"$OVSDB_SERVER_PRIORITY" != X; then - set "$@" --ovsdb-server-priority="$OVSDB_SERVER_PRIORITY" + set "$@" --ovsdb-server-priority="$OVSDB_SERVER_PRIORITY" fi if test X"$VSWITCHD_PRIORITY" != X; then - set "$@" --ovs-vswitchd-priority="$VSWITCHD_PRIORITY" + set "$@" --ovs-vswitchd-priority="$VSWITCHD_PRIORITY" fi if test X"$VSWITCHD_MLOCKALL" != X; then - set "$@" --mlockall="$VSWITCHD_MLOCKALL" + set "$@" --mlockall="$VSWITCHD_MLOCKALL" fi if test ! -e /var/run/openvswitch.booted; then touch /var/run/openvswitch.booted @@ -92,9 +92,9 @@ force_reload_kmod () { # Restart the high-availability daemon if it is running. Otherwise # it loses its heartbeat and reboots the system after a few minutes. if pidof xhad >/dev/null && test -e /etc/xensource/xhad.conf; then - PATH=$PATH:/opt/xensource/xha - action "Stopping HA daemon" ha_stop_daemon - action "Starting HA daemon" ha_start_daemon + PATH=$PATH:/opt/xensource/xha + action "Stopping HA daemon" ha_stop_daemon + action "Starting HA daemon" ha_start_daemon fi action "Stopping ovs-xapi-sync" stop_daemon ovs-xapi-sync