diff mbox series

[ovs-dev,2.12,2/4] ovn-controller: Fix meter-table-list and group-table-list commands.

Message ID 1576957867-69488-3-git-send-email-hzhou@ovn.org
State Accepted
Commit c5687ee6ebcaf15df82218d58803d6f0c88eb9a9
Headers show
Series Fix reusing meter/group by multiple logical flows. | expand

Commit Message

Han Zhou Dec. 21, 2019, 7:51 p.m. UTC
These commands are supposed to print existing items of the tables,
but they actually print only items that is in existing table but not
in desired table, which is useless because this would print nothing
in normal conditions. The patch fixes it so that they behave as
what the document says.

Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Han Zhou <hzhou@ovn.org>
---
 ovn/controller/ovn-controller.c | 6 +++---
 tests/ovn.at                    | 5 ++++-
 2 files changed, 7 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c
index c8bf29d..e2fce92 100644
--- a/ovn/controller/ovn-controller.c
+++ b/ovn/controller/ovn-controller.c
@@ -2317,9 +2317,9 @@  extend_table_list(struct unixctl_conn *conn, int argc OVS_UNUSED,
     struct ds ds = DS_EMPTY_INITIALIZER;
     struct simap items = SIMAP_INITIALIZER(&items);
 
-    struct ovn_extend_table_info *installed, *next;
-    EXTEND_TABLE_FOR_EACH_INSTALLED (installed, next, extend_table) {
-        simap_put(&items, installed->name, installed->table_id);
+    struct ovn_extend_table_info *item;
+    HMAP_FOR_EACH (item, hmap_node, &extend_table->existing) {
+        simap_put(&items, item->name, item->table_id);
     }
 
     const struct simap_node **nodes = simap_sort(&items);
diff --git a/tests/ovn.at b/tests/ovn.at
index 54aa19b..3acd8a1 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -7319,7 +7319,10 @@  echo "Meter duration: $d_secs"
 AT_SKIP_IF([test $d_secs -gt 9])
 
 # Print some information that may help debugging.
-as hv ovs-appctl -t ovn-controller meter-table-list
+AT_CHECK([as hv ovs-appctl -t ovn-controller meter-table-list], [0], [dnl
+http-rl1: 1
+http-rl2: 2
+])
 as hv ovs-ofctl -O OpenFlow13 meter-stats br-int
 
 n_acl1=$(grep -c 'http-acl1' hv/ovn-controller.log)