From: Ian Jackson Subject: Re: [PATCH]: xl: introduce xlu_cfg_get_(string|long)_default Date: Tue, 31 Aug 2010 18:15:33 +0100 Message-ID: <19581.14517.994776.719892@mariner.uk.xensource.com> References: <1283269353.25936.9.camel@qabil.uk.xensource.com> <19581.13001.354762.600142@mariner.uk.xensource.com> <1283274266.20276.11.camel@qabil.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1283274266.20276.11.camel@qabil.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Gianni Tedesco Cc: Ian Campbell , Xen Devel , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Gianni Tedesco writes ("Re: [PATCH]: xl: introduce xlu_cfg_get_(string|long)_default"): > I had considered that approach first but then discarded it because it > was hard to tell which values had been set or not, eg. if a boolean > option had been set to 0 by an explicit config entry or due to initial > memset() - meaning that you wouldn't know whether to override it with a > default or not. IOW we would need a bitmap or something to keep track. Yes. Either a bitmap for which values are valid, or a convention that booleans are ints which are given -1 or +1 values, or something. > Perhaps a higher level API would be better: ... > {.type = STR, .u.str = {&dm_info.vnclisten, "127.0.0.1"}, }, Urgh, that's overly complicated, I think. Ian.