[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/5] libxl: add xlu_cfg_get_type function



Andre Przywara writes ("Re: [Xen-devel] [PATCH 2/5] libxl: add xlu_cfg_get_type 
function"):
> But there is only xlu_cfg_get_long, which returns signed values (used 28 
> times in xl_cmdimpl.c). I don't see any usage of strtoul in xl_cmdimpl.c 
> which is preceded by xlu_cfg_get_string().

That's true, although it may not remain so forever.  But my other
arguments stand I think.

> >  Secondly, if callers say things like
> >   if (type == XLU_CFG_STRING) ....
> > they'll have a bug.
> > I would suggest XLU_CFG_ATOM.  Callers can use strto[u]l (or whatever)
> > themselves if they need to distinguish numbers from strings.
>
> Makes sense. Do you mean like the attached delta patch?

Right, yes, that seems sensible.

> I could also live with making the reporting of the error in 
> libxl_cfg_get_list() optional, so that users aren't bothered with a 
> confusing error output everytime. That would make the whole function 
> obsolete.

That would be fine too.

> Tell me what you like more.

My usual rule is "do whatever makes the code smaller".  I guess in
this case that probably means have the error reporting flag on
libxl_cfg_get_list.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.