WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: Andre Przywara <andre.przywara@xxxxxxx>
Subject: Re: [Xen-devel] [PATCH 2/5] libxl: add xlu_cfg_get_type function
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Fri, 17 Sep 2010 16:59:09 +0100
Cc: Stefano, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, Stabellini <stefano.stabellini@xxxxxxxxxxxxx>, Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Delivery-date: Fri, 17 Sep 2010 09:00:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4C93534B.60008@xxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Newsgroups: chiark.mail.xen.devel
References: <4C921675.2030702@xxxxxxx> <19602.20530.392609.592745@xxxxxxxxxxxxxxxxxxxxxxxx> <4C93534B.60008@xxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>