[ovs-dev] [PATCH v4 1/3] id-pool: Add interface to check if id has been allocated

Flavio Leitner fbl at sysclose.org
Fri Sep 4 12:59:19 UTC 2020


On Fri, Sep 04, 2020 at 08:42:25AM +0100, Mark Gray wrote:
> On 01/09/2020 16:10, Flavio Leitner wrote:
> > 
> > Hi Mark,
> > 
> > Sort of nitpicking but looks like making id_pool_find()
> > public would be better because I don't know what is
> > being checked in the new function. 
> > 
> > The new function is a simple wrapper around _find()
> > and to me either _find() or _lookup() names translate
> > better to what is being done.
> > 
> > What do you think?
> > 
> > fbl
> > 
> 
> It's not nitpicking :D I did think of that but id_pool_find() returns a
> private object (id_node) so I'd have to expose that, breaking the
> encapsulation of id-pool which I didn't want to do.
> 
> Perhaps I could change the public name to _lookup() or something like
> id_pool_is_id_avail()?

That works for me. OVS also uses _has_, so another suggestion would
be id_pool_has_id(), which is shorter. ;)

bool ofproto_has_snoops()
bool connmgr_has_snoops()
bool ofproto_rule_has_out_port()
bool ofproto_rule_has_out_group()
bool minimask_has_extra()
bridge_has_bond_fake_iface()
bool ovsdb_idl_has_lock()
[...]

-- 
fbl


More information about the dev mailing list