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 <[email protected]>
Signed-off-by: Han Zhou <[email protected]>
---
 ovn/controller/ovn-controller.c | 6 +++---
 tests/ovn.at                    | 5 ++++-
 2 files changed, 7 insertions(+), 4 deletions(-)

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)
-- 
2.1.0

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

Reply via email to