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

Han Zhou hzhou at ovn.org
Fri Dec 6 22:28:53 UTC 2019


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.

Signed-off-by: Han Zhou <hzhou at ovn.org>
---
 controller/ovn-controller.c | 6 +++---
 tests/ovn.at                | 5 ++++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index f836ffb..97be360 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -2432,9 +2432,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 8f4d9a4..5dc7af2 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -7363,7 +7363,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)
-- 
2.1.0



More information about the dev mailing list