From: Wei Liu Subject: Re: [PATCH v4 20/21] libxlu: introduce new APIs Date: Thu, 12 Feb 2015 10:57:40 +0000 Message-ID: <20150212105740.GD13644@zion.uk.xensource.com> References: <1422011632-22018-1-git-send-email-wei.liu2@citrix.com> <1422011632-22018-21-git-send-email-wei.liu2@citrix.com> <21723.32911.834082.657000@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <21723.32911.834082.657000@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Wei Liu , ian.campbell@citrix.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, xen-devel@lists.xen.org, JBeulich@suse.com, ufimtseva@gmail.com List-Id: xen-devel@lists.xenproject.org On Wed, Feb 11, 2015 at 04:17:19PM +0000, Ian Jackson wrote: > Wei Liu writes ("[PATCH v4 20/21] libxlu: introduce new APIs"): > > These APIs can be used to manipulate XLU_ConfigValue and XLU_ConfigList. > ... > > +const char *xlu_cfg_value_get_string(const XLU_ConfigValue *value) > > +{ > > + assert(value->type == XLU_STRING); > > + return value->u.string; > > +} > > Most of the existing xlu_cfg_... functions return null (or -1) setting > EINVAL if the type of the supplied config item is not correct. > > But these new functions are not really suitable for use directly > because they crash on incorrect configuration input. > > Wouldn't it be better if these functions had calling conventions > similar to xlu_cfg_get_string et al (returning errno values, taking > dont_warn, etc.) ? > Right. I will use the same convention. Wei. > Thanks, > Ian.