From patchwork Thu May 25 13:38:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timothy Redaelli X-Patchwork-Id: 766965 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 3wYVjv2SZzz9s7y for ; Thu, 25 May 2017 23:39:31 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 7D899B6D; Thu, 25 May 2017 13:39:28 +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 2AF53904 for ; Thu, 25 May 2017 13:39:27 +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 B37A2AD for ; Thu, 25 May 2017 13:39:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E57A2C04B950 for ; Thu, 25 May 2017 13:39:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E57A2C04B950 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=tredaelli@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E57A2C04B950 Received: from graphite.mxp.redhat.com (dhcp-176-62.mxp.redhat.com [10.32.176.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9CD8A7DFE6; Thu, 25 May 2017 13:39:23 +0000 (UTC) From: Timothy Redaelli To: dev@openvswitch.org Date: Thu, 25 May 2017 15:38:39 +0200 Message-Id: <927260eabe0127fc851b0a3e2b2458d03fa9dfdf.1495719241.git.tredaelli@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 25 May 2017 13:39:26 +0000 (UTC) X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v2 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 --- Changed since v1: * Added --delete-transient-ports-on-boot flag to manpage 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 84fa33f..a15d729 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 575ffa0..c3130fa 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 } @@ -503,6 +508,7 @@ set_defaults () { DELETE_BRIDGES=no DELETE_TRANSIENT_PORTS=no + DELETE_TRANSIENT_PORTS_ON_BOOT=no DAEMON_CWD=/ FORCE_COREFILES=yes