ovsdb-idl: Make rows inserted by transaction appear during table iteration.
[openvswitch] / lib / ovsdb-idl.c
index 7bbe6bf05feb6438220985a10116912726a3e5d4..960e0866dc967c674c05a70344513e7199ea09a2 100644 (file)
@@ -799,7 +799,7 @@ next_real_row(struct ovsdb_idl_table *table, struct hmap_node *node)
         struct ovsdb_idl_row *row;
 
         row = CONTAINER_OF(node, struct ovsdb_idl_row, hmap_node);
-        if (!ovsdb_idl_row_is_orphan(row)) {
+        if (row->new || !ovsdb_idl_row_is_orphan(row)) {
             return row;
         }
     }
@@ -1300,8 +1300,10 @@ ovsdb_idl_txn_verify(const struct ovsdb_idl_row *row_,
 }
 
 void
-ovsdb_idl_txn_delete(struct ovsdb_idl_row *row)
+ovsdb_idl_txn_delete(const struct ovsdb_idl_row *row_)
 {
+    struct ovsdb_idl_row *row = (struct ovsdb_idl_row *) row_;
+
     assert(row->new != NULL);
     if (!row->old) {
         ovsdb_idl_row_clear_new(row);
@@ -1319,7 +1321,7 @@ ovsdb_idl_txn_delete(struct ovsdb_idl_row *row)
     row->new = NULL;
 }
 
-struct ovsdb_idl_row *
+const struct ovsdb_idl_row *
 ovsdb_idl_txn_insert(struct ovsdb_idl_txn *txn,
                      const struct ovsdb_idl_table_class *class)
 {