From patchwork Fri Aug 11 16:06:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Redaelli X-Patchwork-Id: 800633 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) 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 3xTVKk3PhGz9s7M for ; Sat, 12 Aug 2017 02:07:40 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 87C3DB77; Fri, 11 Aug 2017 16:06:49 +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 8D0E7B6E for ; Fri, 11 Aug 2017 16:06:47 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3BCE8180 for ; Fri, 11 Aug 2017 16:06:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 849421322C for ; Fri, 11 Aug 2017 16:06:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 849421322C Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=tredaelli@redhat.com Received: from graphite.redhat.com (ovpn-117-84.ams2.redhat.com [10.36.117.84]) by smtp.corp.redhat.com (Postfix) with ESMTP id F31206D29E for ; Fri, 11 Aug 2017 16:06:45 +0000 (UTC) From: Timothy Redaelli To: dev@openvswitch.org Date: Fri, 11 Aug 2017 18:06:40 +0200 Message-Id: <50d80072abf613afacb816c8bffa003d7491044d.1502466863.git.tredaelli@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 11 Aug 2017 16:06:46 +0000 (UTC) Subject: [ovs-dev] [PATCH v3 1/2] ovs-ctl: Add option to delete transient ports only on boot. 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 The first time after boot, when openvswitch is started by using --delete-transient-ports-on-boot ovs-ctl option, all transient ports will be removed. Signed-off-by: Timothy Redaelli --- utilities/ovs-ctl.8 | 13 ++++++++++++- utilities/ovs-ctl.in | 6 ++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/utilities/ovs-ctl.8 b/utilities/ovs-ctl.8 index 84fa33fff..a15d72992 100644 --- a/utilities/ovs-ctl.8 +++ b/utilities/ovs-ctl.8 @@ -95,11 +95,16 @@ bridges from the database. If the \fB\-\-delete\-transient\-ports\fR option was used, deletes all ports that have \fBother_config:transient\fR set to true. . +.IP 7. +If the \fB\-\-delete\-transient\-ports\-on\-boot\fR option was used, deletes +all ports that have \fBother_config:transient\fR set to true, but only the +first time after a boot. +. .PP The \fBstart\fR command skips the following step if \fBovs\-vswitchd\fR is already running, or if the \fB\-\-no\-ovs\-vswitchd\fR command option is given: -.IP 7. +.IP 8. Starts \fBovs\-vswitchd\fR. . .SS "Options" @@ -159,6 +164,12 @@ Deletes all ports that have the other_config:transient value set to true. This is important on certain environments where some ports are going to be recreated after reboot, but other ports need to be persisted in the database. . +.IP "\fB\-\-delete\-transient\-ports\-on\-boot\fR" +The first time after a boot, deletes all ports that have the +other_config:transient value set to true. This is important on certain +environments where some ports are going to be recreated after reboot, +but other ports need to be persisted in the database. +. .IP "\fB\-\-ovs\-user=user[:group]\fR" Ordinarily Open vSwitch daemons are started as the user invoking the ovs-ctl command. Some system administrators would prefer to have the various daemons diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in index dc1d02c9c..6fd72f759 100755 --- a/utilities/ovs-ctl.in +++ b/utilities/ovs-ctl.in @@ -189,6 +189,11 @@ do_start_ovsdb () { if test X"$DELETE_TRANSIENT_PORTS" = Xyes; then del_transient_ports fi + if test X"$DELETE_TRANSIENT_PORTS_ON_BOOT" = Xyes && \ + ! test -f "$rundir/deleted_transient_ports"; then + del_transient_ports + : > "$rundir/deleted_transient_ports" + fi fi } @@ -500,6 +505,7 @@ set_defaults () { DELETE_BRIDGES=no DELETE_TRANSIENT_PORTS=no + DELETE_TRANSIENT_PORTS_ON_BOOT=no DAEMON_CWD=/ FORCE_COREFILES=yes