[ovs-dev] [PATCH 3/3] smap: Return default on failure in smap_get_int/ullong.

Ben Pfaff blp at ovn.org
Fri Dec 1 16:51:22 UTC 2017


On Fri, Dec 01, 2017 at 02:03:29PM +0300, Ilya Maximets wrote:
> On 29.11.2017 17:59, Jan Scheurich wrote:
> > Thanks for fixing this. Applying the default value is better than silently applying 0.
> > Even better would be to flag an error in this case...
> 
> Thanks for review and testing.
> 
> I hope that someday we will have type checking support from the ovsdb side
> for such maps like 'other_config'. This could prevent storing completely
> wrong values in database.
> 
> Ben, what do you think? Is it possible?

It's possible, but it does not yet strike me as a good idea.  If there
is a setting that is commonly used, then it may make sense to create a
column for that purpose, in which case type checking is not a problem.
If a setting is not commonly used, then it may not be a big deal if it
is easier to make mistakes.


More information about the dev mailing list