diff mbox series

[ovs-dev,v7,06/12] physical: Make use of common can bind helper.

Message ID 20211019102205.3837601-6-frode.nordahl@canonical.com
State Accepted
Headers show
Series Introduce infrastructure for plug providers | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes fail github build: failed

Commit Message

Frode Nordahl Oct. 19, 2021, 10:21 a.m. UTC
The physical module currently has an inverse version of
`lport_can_bind_on_this_chassis` duplicated in its code.

Make use of the common helper instead.

Signed-off-by: Frode Nordahl <frode.nordahl@canonical.com>
---
 controller/physical.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/controller/physical.c b/controller/physical.c
index ac16a6a3b..aa1d44bc6 100644
--- a/controller/physical.c
+++ b/controller/physical.c
@@ -1069,11 +1069,7 @@  consider_port_binding(struct ovsdb_idl_index *sbrec_port_binding_by_name,
     } else {
         ofport = local_binding_get_lport_ofport(local_bindings,
                                                 binding->logical_port);
-        const char *requested_chassis = smap_get(&binding->options,
-                                                 "requested-chassis");
-        if (ofport && requested_chassis && requested_chassis[0] &&
-            strcmp(requested_chassis, chassis->name) &&
-            strcmp(requested_chassis, chassis->hostname)) {
+        if (ofport && !lport_can_bind_on_this_chassis(chassis, binding)) {
             /* Even though there is an ofport for this port_binding, it is
              * requested on a different chassis. So ignore this ofport.
              */