On Mon, Mar 28, 2016 at 5:01 PM, Ben Pfaff <b...@ovn.org> wrote:

> On Mon, Mar 28, 2016 at 03:52:17PM -0400, Russell Bryant wrote:
> > Publish ovn-controller's local bridge mappings configuration
> > in the external_ids column of the Chassis table.  Having this
> > information available for reading is useful to applications
> > integrating with OVN.
> >
> > Signed-off-by: Russell Bryant <russ...@ovn.org>
>
> "external-ids" is usually a column that different applications should
> share.  I think that's the intent here, because the code modifies the
> existing contents of the column rather than replacing it wholesale, but
> to ensure atomic transactional behavior, the code should ensure that the
> column hasn't changed since it was read, by calling
> sbrec_chassis_verify_externals_ids() before it sets it, e.g. just before
> the sbrec_chassis_set_external_ids() call below:


Yes, that's the intent.  and oops, I forgot verify().  Thanks for catching
that.


>
> > +        const char *chassis_bridge_mappings
> > +            = smap_get(&chassis_rec->external_ids,
> "ovn-bridge-mappings");
> > +        if (!chassis_bridge_mappings) {
> > +            chassis_bridge_mappings = "";
> > +        }
> > +        if (strcmp(bridge_mappings, chassis_bridge_mappings)) {
> > +            struct smap new_ids;
> > +            smap_clone(&new_ids, &chassis_rec->external_ids);
> > +            smap_replace(&new_ids, "ovn-bridge-mappings",
> bridge_mappings);
> > +            sbrec_chassis_set_external_ids(chassis_rec, &new_ids);
> > +            smap_destroy(&new_ids);
> > +        }
> > +
>
> Also, s/applicatoins/applications/ here:
>
> > +    <column name="external_ids" key="ovn-bridge-mappings">
> > +      <code>ovn-controller</code> populates this key with the set of
> bridge
> > +      mappings it has been configured to use.  Other applicatoins
> should treat
> > +      this key as read-only.  See <code>ovn-controller</code>(8) for
> more
> > +      information.
> > +    </column>
>

Thanks,

-- 
Russell Bryant
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to