diff mbox series

[ovs-dev,2/2] ovn: Modify restart_controller in ovn-ctl to use --restart

Message ID 20180724203006.12700-3-mmichels@redhat.com
State Superseded
Headers show
Series Allow for smoother restarting of ovn-controller | expand

Commit Message

Mark Michelson July 24, 2018, 8:30 p.m. UTC
The --restart flag allows for uninterrupted packet flowage when exiting
ovn-controller. This patch modifies the restart_controller argument to
ovn-ctl to use --restart.

Signed-off-by: Mark Michelson <mmichels@redhat.com>
---
 ovn/utilities/ovn-ctl | 4 ++--
 utilities/ovs-lib.in  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Jakub Sitnicki July 30, 2018, 11:06 a.m. UTC | #1
On Tue, 24 Jul 2018 16:30:06 -0400
Mark Michelson <mmichels@redhat.com> wrote:

> The --restart flag allows for uninterrupted packet flowage when exiting
> ovn-controller. This patch modifies the restart_controller argument to
> ovn-ctl to use --restart.
> 
> Signed-off-by: Mark Michelson <mmichels@redhat.com>
> ---
>  ovn/utilities/ovn-ctl | 4 ++--
>  utilities/ovs-lib.in  | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/ovn/utilities/ovn-ctl b/ovn/utilities/ovn-ctl
> index 2fce47714..f76248e84 100755
> --- a/ovn/utilities/ovn-ctl
> +++ b/ovn/utilities/ovn-ctl
> @@ -350,7 +350,7 @@ stop_northd () {
>  }
>  
>  stop_controller () {
> -    OVS_RUNDIR=${OVN_RUNDIR} stop_daemon ovn-controller
> +    OVS_RUNDIR=${OVN_RUNDIR} stop_daemon ovn-controller $1
>  }

Might be less surprising if the wrapper passed all arguments
to the target command, but this works too.

>  
>  stop_controller_vtep () {
> @@ -367,7 +367,7 @@ restart_northd () {
>  }
>  
>  restart_controller () {
> -    stop_controller
> +    stop_controller --restart
>      start_controller
>  }
>  
> diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
> index 92f98ad92..9f62dfd25 100644
> --- a/utilities/ovs-lib.in
> +++ b/utilities/ovs-lib.in
> @@ -258,7 +258,7 @@ stop_daemon () {
>                  case $action in
>                      EXIT)
>                          action "Exiting $1 ($pid)" \
> -                            ${bindir}/ovs-appctl -T 1 -t $rundir/$1.$pid.ctl exit
> +                            ${bindir}/ovs-appctl -T 1 -t $rundir/$1.$pid.ctl exit $2
>                          ;;
>                      TERM)
>                          action "Killing $1 ($pid)" kill $pid
diff mbox series

Patch

diff --git a/ovn/utilities/ovn-ctl b/ovn/utilities/ovn-ctl
index 2fce47714..f76248e84 100755
--- a/ovn/utilities/ovn-ctl
+++ b/ovn/utilities/ovn-ctl
@@ -350,7 +350,7 @@  stop_northd () {
 }
 
 stop_controller () {
-    OVS_RUNDIR=${OVN_RUNDIR} stop_daemon ovn-controller
+    OVS_RUNDIR=${OVN_RUNDIR} stop_daemon ovn-controller $1
 }
 
 stop_controller_vtep () {
@@ -367,7 +367,7 @@  restart_northd () {
 }
 
 restart_controller () {
-    stop_controller
+    stop_controller --restart
     start_controller
 }
 
diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
index 92f98ad92..9f62dfd25 100644
--- a/utilities/ovs-lib.in
+++ b/utilities/ovs-lib.in
@@ -258,7 +258,7 @@  stop_daemon () {
                 case $action in
                     EXIT)
                         action "Exiting $1 ($pid)" \
-                            ${bindir}/ovs-appctl -T 1 -t $rundir/$1.$pid.ctl exit
+                            ${bindir}/ovs-appctl -T 1 -t $rundir/$1.$pid.ctl exit $2
                         ;;
                     TERM)
                         action "Killing $1 ($pid)" kill $pid