On Wed, Oct 21, 2015 at 09:45:24PM -0700, Andy Zhou wrote:
> Added ovsdb_transient_datum_from_json() to avoid size check for
> the diff datum that is transient in nature.
> Suppose a datum contains set, and the max number of elements is 2.
> If we are changing from set that contains [A, B], to a set contains
> [C, D], the diff datum will contains 4 elements [A, B, C, D].
> 
> Thus diff datum should not be constrained by the size limit. However
> the datum after diff is applied should not violate the size limit.
> 
> Signed-off-by: Andy Zhou <az...@nicira.com>

I'd consider doing this as a wrapper around ovsdb_datum_from_json(),
something like:

        struct ovsdb_type relaxed_type = *type;
        relaxed_type.n_min = 0;
        relaxed_type.n_max = UINT_MAX;
        return ovsdb_datum_from_json(datum, &relaxed_type, json);

This slightly reduces the duplicated code.        
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to