[ovs-dev] [PATCH 1/2] ovsdb-idl: Make it possible to omit or pay less attention to columns.

Justin Pettit jpettit at nicira.com
Wed Aug 11 22:30:20 UTC 2010


On Aug 11, 2010, at 3:26 PM, Ben Pfaff wrote:

>>> +/* By default, 'idl' replicates all of the columns in the remote database, and
>>> + * ovsdb_idl_run() returns true upon a change to any column in the database.
>>> + * Call this function to avoid alerting ovsdb_idl_run()'s caller upon changes
>>> + * to 'column'.
>>> + *
>>> + * This is useful for columns that a client treats as "write-only", that is, it
>>> + * updates them but doesn't want to get alerted about its own updates.  It also
>>> + * won't be alerted about other clients' updates, so this is suitable only for
>>> + * use by a client that "owns" a particular column.
>>> + *
>>> + * The client must be careful not to retain pointers to data in 'column' across
>>> + * calls to ovsdb_idl_run(), even when that function returns false, because
>>> + * the client is not alerted to changes.
>>> + *
>>> + * This function should be called after ovsdb_idl_create(), but before the
>>> + * first call to ovsdb_idl_run().  This function is mutually exclusive with
>>> + * ovsdb_idl_omit() for any given column. */
>>> +void
>>> +ovsdb_idl_set_write_only(struct ovsdb_idl *idl,
>>> +                         const struct ovsdb_idl_column *column)
>>> +{
>>> +    ovsdb_idl_set_mode(idl, column, OVSDB_IDL_MODE_WO);
>>> +}
>> 
>> It might be nice to note that there's no turning back once this
>> function has been called, based on the assertion above.
> 
> Doesn't the comment already say that?

I took the comment to mean that it can't be in both the omit and write-only state...not that the program will assert() if you try to change it.

--Justin






More information about the dev mailing list