Setting container port up was not always properly logged.
Also, do not (try to) write up in sb and do not log it if the port was
already up in sb.

Cherry-picked from origin/main.

Signed-off-by: Xavier Simonart <[email protected]>
---
 controller/binding.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/controller/binding.c b/controller/binding.c
index c6f6a5598..a09763f63 100644
--- a/controller/binding.c
+++ b/controller/binding.c
@@ -982,7 +982,6 @@ local_binding_set_up(struct shash *local_bindings, const 
char *pb_name,
 
     if (!sb_readonly && lbinding && b_lport && b_lport->pb->n_up &&
             !b_lport->pb->up[0] && b_lport->pb->chassis == chassis_rec) {
-        VLOG_INFO("Setting lport %s up in Southbound", pb_name);
         binding_lport_set_up(b_lport, sb_readonly);
         LIST_FOR_EACH (b_lport, list_node, &lbinding->binding_lports) {
             binding_lport_set_up(b_lport, sb_readonly);
@@ -1216,7 +1215,7 @@ claimed_lport_set_up(const struct sbrec_port_binding *pb,
 {
     bool up = true;
     if (!parent_pb || (parent_pb->n_up && parent_pb->up[0])) {
-        if (pb->n_up) {
+        if (pb->n_up && !pb->up[0]) {
             VLOG_INFO("Setting lport %s up in Southbound",
                       pb->logical_port);
             sbrec_port_binding_set_up(pb, &up, 1);
@@ -3561,6 +3560,7 @@ binding_lport_set_up(struct binding_lport *b_lport, bool 
sb_readonly)
         return;
     }
 
+    VLOG_INFO("Setting lport %s up in Southbound", b_lport->pb->logical_port);
     bool up = true;
     sbrec_port_binding_set_up(b_lport->pb, &up, 1);
 }
-- 
2.47.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to