diff mbox

[ovs-dev] ovsdb-idl.c: improves ovsdb_idl_add_table() comment.

Message ID 5A9B630AA769064AAC135067670693D0016846@G4W3220.americas.hpqcorp.net
State Accepted
Headers show

Commit Message

Aymerich, Edward Nov. 27, 2015, 4:57 p.m. UTC
The new comment reflects with more clarity what ovsdb_idl_add_table() does.
Previous comment could be misunderstood, leading to believe that this function
replicates all columns on IDL. Hopefully this fix clarifies that columns are
not replicated, just minimal data for reference integrity is replicated.
A comment in ovsdb_idl_table_class is also modified to better reflect this
behaviour.

Signed-off-by: Edward Aymerich <edward.aymerich@hpe.com>
---
--
2.4.90

Comments

Ben Pfaff Nov. 30, 2015, 6:54 p.m. UTC | #1
On Fri, Nov 27, 2015 at 04:57:07PM +0000, Aymerich, Edward wrote:
> The new comment reflects with more clarity what ovsdb_idl_add_table() does.
> Previous comment could be misunderstood, leading to believe that this function
> replicates all columns on IDL. Hopefully this fix clarifies that columns are
> not replicated, just minimal data for reference integrity is replicated.
> A comment in ovsdb_idl_table_class is also modified to better reflect this
> behaviour.
> 
> Signed-off-by: Edward Aymerich <edward.aymerich@hpe.com>

Thank you.  I agree that this is an improvement, and I applied this
patch to the master branch.  I think it's your first contribution;
welcome to the project!
diff mbox

Patch

diff --git a/lib/ovsdb-idl-provider.h b/lib/ovsdb-idl-provider.h
index 3dddf69..099535e 100644
--- a/lib/ovsdb-idl-provider.h
+++ b/lib/ovsdb-idl-provider.h
@@ -61,7 +61,8 @@  struct ovsdb_idl_table_class {
 struct ovsdb_idl_table {
     const struct ovsdb_idl_table_class *class;
     unsigned char *modes;    /* OVSDB_IDL_* bitmasks, indexed by column. */
-    bool need_table;         /* Monitor table even if no columns? */
+    bool need_table;         /* Monitor table even if no columns are selected
+                              * for replication. */
     struct shash columns;    /* Contains "const struct ovsdb_idl_column *"s. */
     struct hmap rows;        /* Contains "struct ovsdb_idl_row"s. */
     struct ovsdb_idl *idl;   /* Containing idl. */
diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c
index 588582a..8f75bf0 100644
--- a/lib/ovsdb-idl.c
+++ b/lib/ovsdb-idl.c
@@ -557,11 +557,13 @@  ovsdb_idl_add_column(struct ovsdb_idl *idl,
 }

 /* Ensures that the table with class 'tc' will be replicated on 'idl' even if
- * no columns are selected for replication.  This can be useful because it
- * allows 'idl' to keep track of what rows in the table actually exist, which
- * in turn allows columns that reference the table to have accurate contents.
- * (The IDL presents the database with references to rows that do not exist
- * removed.)
+ * no columns are selected for replication. Just the necessary data for table
+ * references will be replicated (the UUID of the rows, for instance), any
+ * columns not selected for replication will remain unreplicated.
+ * This can be useful because it allows 'idl' to keep track of what rows in the
+ * table actually exist, which in turn allows columns that reference the table
+ * to have accurate contents. (The IDL presents the database with references to
+ * rows that do not exist removed.)
  *
  * This function is only useful if 'monitor_everything_by_default' was false in
  * the call to ovsdb_idl_create().  This function should be called between